Linux native and server file interchange and Linux server file upload and download command writing

  • 2020-06-23 02:19:02
  • OfStack

1. Linux file transfer, scp command instance

1. Copy the directory under Linux: native - > Remote server


scp -r /home/abc/test1 root@192.168.0.1:/home/bcd/test2
     (Native directory path    Remote machine user name @IP:/ Directory) 

2, Linux directory replication: remote server - > This machine


scp -r  root@192.168.0.1:/home/bcd/test2  /home/abc/test1
 Remote machine user name @IP:/ directory          Native directory path) 

3. File replication under Linux: remote server - > This machine


scp -P 22 root@192.168.0.1:/home/1.txt /home/1.txt

Note: If the port number has been changed, type -ES21en port number after scp (note in uppercase, -p is lowercase in the ssh command)

2. Windows and Linux mutual transmission, pscp command instance

(Note: There are many ways to do this, using the pscp command.)

Premise: Download ES35en.exe and set the path environment variable.

cmd command:

Upload:


pscp d:\upload.txt  username@192.168.1.1:/home/username/upload/upload.txt

Download:


pscp root@192.168.1.1:/home/username/download/download.txt  d:\download.txt

conclusion


Related articles: