Linux Connection FTP command to achieve bulk download

Source: Internet
Author: User
Tags ftp connection

Recently wanted to download a Web site from the United States server, found that the speed of FTP is often 0.1k/seconds

My God, it's so slow. Google's agent is also not good to use. Use the agent on the link is not on.

Find a friend of the domestic multi-line room, it is fast a lot.

Linux FTP connection, use, all rely on the command line.

1. Connecting to an FTP server

Format: FTP [hostname| ip-address]
A) at the Linux command line, enter:
FTP 192.168.1.1

b The server asks you username and password, enter the username and the corresponding password respectively, wait for authentication to pass.

2. Download File www.111cn.net

The download file usually uses the get and mget two commands.
a) Get
Format: Get [Remote-file] [Local-file]
Transfers files from the remote host to the local host.
To obtain/usr/your/1.htm on a remote server, the
ftp> get/usr/your/1.htm 1.htm (carriage 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)

Every time you download a file, you will be prompted. If you want to remove the hint, execute before mget the *.* command: Prompt off

Note: The files are downloaded to the Linux host's current directory. For example, the FTP command that runs under/usr/my, the files are downloaded to the/usr/my.

3. Upload file

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 a local host to a remote host.
To upload all HTML files in the local current directory to the server/usr/your/
Ftp> Cd/usr/your (carriage return)
ftp> mput *.htm (carriage return)

Note: The upload files are from the host's current directory. For example, the FTP command that runs under the/usr/my, only the file Linux under/usr/my will be uploaded to the server/usr/your.

4. Disconnect the connection
Bye: Interrupts the connection to the server.
Ftp> Bye (carriage return)

All of the above methods can only be one download file.

If you want to bulk download, there is another good way.

To be solved by wget

The code is as follows Copy Code
wget ftp://ip:port/*–ftp-user=xxx–ftp-password=xxx-r

Note:
Asterisk * must have, otherwise download down on a file index.html
The-r parameter is used for directory downloads

I will download the file into a zip, it is convenient to pull to the local.

Related Article

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.