Detailed explanation of scp of Linux command

Copy files/folders between two machines under Linux

There are two machines: A:*.101 and B:*.102.

Copy temp/var/a.txt under A to the /text/ directory of machine B:

Enter machine B: scp root@*.101:/temp/var/a.txt /test/

or

Enter machine A: scp /temp/var/a.txt root@*.102:/test/

 

Copy the folder (including subfolders) /temp/var/ under A to the /test/ directory of machine B:

Enter machine B: scp -r root@*.101:/temp/var/a.txt /test/

or

Enter machine A: scp -r /temp/var/a.txt root@*.102:/test/

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325124445&siteId=291194637