Example uses of the Linux Command ftp
2011-10-19 19:38
405 查看
The following examples illustrate typical uses of the command ftp for remotely copying, renaming, and deleting files.
ftp abc.xyz.edu
This command will attempt to connect to the ftp server at abc.xyz.edu. If it succeeds, it will ask you to log in using a username and password. Public ftp servers often allow you to log in using the username "anonymous" and your email address as password. Once
you are logged in you can get a list of the available ftp commands using the help function:
ftp> help
This lists the commands that you can use to show the directory contents, transfer files, and delete files.
ftp> ls
This command prints the names of the files and subdirectories in the current directory on the remote computer.
ftp> cd customers
This command changes the current directory to the subdirecotry "customers", if it exists.
ftp> cd ..
Changes the current directory to the parent direcotry.
ftp> lcd images
Changes the current directory [em]on the local computer[/em] to "images", if it exists.
ftp> ascii
Changes to "ascii" mode for transferring text files.
ftp> binary
Changes to "binary" mode for transferring all files that are not text files.
ftp> get image1.jpg
Downloads the file image1.jpg from the remote computer to the local computer. Warning: If there already is file with the same name it will be overwritten.
ftp> put image2.jpg
Uploads the file image2.jpg from the local computer to the remote computer. Warning: If there already is file with the same name it will be overwritten.
ftp> !ls
A '!' in front will execute the specified command on the local computer. So '!ls' lists the file names and directory names of the current directory on the local computer.
ftp> mget *.jpg
With mget you can download multiple images. This command downloads all files that end with ".jgp".
ftp> mput *.jpg
Uploads all files that end with ".jgp".
ftp> mdelete *.jpg
Deletes all files that end with ".jgp".
ftp> prompt
Turns iteractive mode on or off so that commands on multiple files are executed without user confirmation.
ftp> quit
Exits the ftp program.
from:here
ftp abc.xyz.edu
This command will attempt to connect to the ftp server at abc.xyz.edu. If it succeeds, it will ask you to log in using a username and password. Public ftp servers often allow you to log in using the username "anonymous" and your email address as password. Once
you are logged in you can get a list of the available ftp commands using the help function:
ftp> help
This lists the commands that you can use to show the directory contents, transfer files, and delete files.
ftp> ls
This command prints the names of the files and subdirectories in the current directory on the remote computer.
ftp> cd customers
This command changes the current directory to the subdirecotry "customers", if it exists.
ftp> cd ..
Changes the current directory to the parent direcotry.
ftp> lcd images
Changes the current directory [em]on the local computer[/em] to "images", if it exists.
ftp> ascii
Changes to "ascii" mode for transferring text files.
ftp> binary
Changes to "binary" mode for transferring all files that are not text files.
ftp> get image1.jpg
Downloads the file image1.jpg from the remote computer to the local computer. Warning: If there already is file with the same name it will be overwritten.
ftp> put image2.jpg
Uploads the file image2.jpg from the local computer to the remote computer. Warning: If there already is file with the same name it will be overwritten.
ftp> !ls
A '!' in front will execute the specified command on the local computer. So '!ls' lists the file names and directory names of the current directory on the local computer.
ftp> mget *.jpg
With mget you can download multiple images. This command downloads all files that end with ".jgp".
ftp> mput *.jpg
Uploads all files that end with ".jgp".
ftp> mdelete *.jpg
Deletes all files that end with ".jgp".
ftp> prompt
Turns iteractive mode on or off so that commands on multiple files are executed without user confirmation.
ftp> quit
Exits the ftp program.
from:here
相关文章推荐
- Example uses of the Linux Command ftp
- Example uses of the command "more"
- Get and display the size of file and directory in Linux system using du command 获取和现实linux文件大小(三)
- Linux Netcat command – The swiss army knife of networking
- Linux command: save the output of a command to a file
- SQL:Example Uses of the SUBSTRING String Function
- SQL:Example Uses of the SUBSTRING String Function
- SQL:Example Uses of the SUBSTRING String Function
- Getting over the dangers of rm command in Linux---reference
- An A-Z Index of the Bash command line for Linux.摘自https://ss64.com
- the usage of linux command "expect"
- [Linux-vi] The simple set of vi command
- the diary of sleep jobs & fg command line in linux
- Linux tip - How to query the explanation of a linux command?
- Getting over the dangers of rm command in Linux---reference
- List of FTP commands for the Microsoft command-line FTP client
- in linux system of ftp command
- the diary for one command application of pipe in Linux
- the linux command line学习笔记之三
- An example of the <sql> and <include> tags