Three Commands for Remote File Download in Linux (scp/ftp/wget)

Three Commands for Remote File Download in Linux (scp/ftp/wget)

1scp命令

scp /home/work/source.txt [email protected]:/home/work/ #Copy the local source.txt file to the /home/work directory on the machine 192.168.0.10

scp [email protected]:/home/work/source.txt /home/work/ #Copy the source.txt file from the machine 192.168.0.10 to the local /home/work directory

scp [email protected]:/home/work/source.txt [email protected]:/home/work/ #Copy the source.txt file from the machine 192.168.0.10 to the /home/work directory on the machine 192.168.0.11

scp -r /home/work/sourcedir [email protected]:/home/work/ #Copy a folder, use the -r option

2ftp命令

If the server has an ftp Server installed, another Linux machine can use the ftp client program to perform remote file copying, reading, downloading, and uploading.

1. Connect to the ftp server Format: ftp [hostname| ip-address] a) In the Linux command line, type: ftp 192.168.26.66 b) The server will ask for your username and password; enter the username and corresponding password to authenticate.

2. Download files

Use the get and mget commands to download files. a) get Format: get [remote-file] [local-file] Transfers a file from the remote host to the local host. To get the file e:\rose\1.bmp from the server, type ftp> get /rose/1.bmp 1.bmp (press Enter)

b) mget Format: mget [remote-files] Receives a batch of files from the remote host to the local host. To get all files in e:\rose on the server, type ftp> cd /rose ftp> mget . (press Enter) https://www.cnblogs.com/zhangwuji/p/7152653.html

3、Use wget to download a single file

Command: wget http://www.minjieren.com/wordpress-3.1-zh_CN.zip

Three Commands for Remote File Download in Linux (scp/ftp/wget)

Leave a Comment