File upload and download for FTP server in linux command line mode

Source: Internet
Author: User

Reference Source: Click here to view 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 (or exit)

ftp> Bye (carriage return)

5. Other commands

After connecting to the FTP server, you can use commands such as LS,CD

File upload and download for FTP server in linux command line mode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.