Two ways to download files remotely from Linux FTP commands and SCP commands

Source: Internet
Author: User
Tags file copy ftp commands ftp client pscp scp command

FTP command:

Server has FTP server installed, another Linux can use the FTP client program to copy the file read and download.

1. Connect to the FTP server
Format: FTP [hostname| ip-address]
A) under Linux command line input: FTP 192.168.26.66
b) The server asks 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 E:\rose\1.bmp on the server,
Ftp> get/rose/1.bmp 1.bmp (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 E:\rose\ on the server,
Ftp> Cd/rose
Ftp> mget * * (carriage return)

Note: The files are downloaded to the current directory of the Linux host. For example, the FTP command that runs under/root/yint, the files are downloaded to/root/yint.

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.bmp to the remote host E:\rose, and renamed to 333.bmp
Ftp> put 1.bmp/rose/333.bmp (carriage return)

b) mput
Format: Mput local-files
Transfers a batch of files from the local host to the remote host.
If you want to upload all BMP files in the local current directory to the server E:\rose
Ftp> cd/rose (carriage return)
Ftp> mput *.bmp (return)
Note: The upload file is from the current directory of the host. For example, the FTP command running under/root/test will only be uploaded to the server e:\rose under/root/test file Linux.

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

SCP command:

SCP is a secure file copy, SSH-based login

Suppose you want to copy a file named A.tar.tz under the local computer/home to/home/tmp on the remote server 192.168.0.2. And your account name is root on the remote server. You can use this command:
Scp/home/a.tar.tz [Email protected]:/home/tmp/

If you copy the file from the remote machine to the current directory of the machine, use this command:
SCP [Email Protected]:/home/a.tar.tz

Copy files from the entire directory of the remote machine
scp-r [email protected]:/home/*./

Content Source: http://www.cnblogs.com/weafer/archive/2011/06/13/2079509.html

--------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------

Add:

If you are downloading to the Windows platform using SCP, there are two ways to do this:

1. WINSCP tool, a graphical tool

2. Putty (PSCP)

The command is as follows:

Download:

PSCP [Email protected]:/etc/hosts c:\temp\example-hosts.txt

Upload:

PSCP c:\documents\foo.txt [Email Protected]:/tmp/foo


In addition, if you use Xshell, you can also use the SZ and RZ commands to upload and download.


Two ways to download files remotely from Linux FTP commands and SCP commands

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.