Two ways to download files remotely from Linux FTP commands and SCP commands
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/*./
FTP commands and SCP commands for two ways to download files remotely from Linux