1. Connect to the FTP server
Format: FTP [hostname| ip-address]
A) under the Linux command line, enter:
FTP 192.168.1.1
b) The server asks for your user name and password, enter the user name and the corresponding password, respectively, to be certified.
2. Download the file
The download file usually uses the get and mget two commands.
a) Get
Format: Get [Remote-file] [Local-file]
Transfer files from the remote host to the local host.
To get/usr/your/1.htm on a remote server,
Ftp> get/usr/your/1.htm 1.htm (return)
b) mget
Format: mget [Remote-files]
Receives a batch of files from the remote host to the local host.
To get all the files under/usr/your/on the server,
Ftp> cd/usr/your/
Ftp> mget * * (carriage return)
Each time you download a file, you will be prompted. If you want to remove the hint, do it before the mget. * * Command:prompt off
Note: The files are downloaded to the current directory of the Linux host. For example, the FTP command that runs under/usr/my, the files are downloaded to/usr/my.
3. Uploading Files
a) put
Format: Put Local-file [Remote-file]
Transfers a local file to the remote host.
If you want to transfer the local 1.htm to the remote host/usr/your, and renamed to 2.htm
Ftp> put 1.htm/usr/your/2.htm (carriage return)
b) mput
Format: Mput local-files
Transfers a batch of files from the local host to the remote host.
To upload all the HTML files in the local current directory to the server/usr/your/
Ftp> Cd/usr/your (carriage return)
Ftp> mput *.htm (return)
Note: The upload file is from the current directory of the host. For example, the FTP command running under/usr/my will only be uploaded to the server/usr/your under/usr/my file Linux.
4. Disconnect the connection
Bye: Interrupts the connection to the server.
ftp> Bye (carriage return)
Common FTP commands under Linux 1. Connecting to an FTP server [go]