Simple copy through SSH
June 25, 2008 · Filed Under Linux
Copying files between remote machines can be easily done
using SCP command.
The syntax is:
copy from a remote machine to my machine:
scp user@192.168.0.1:/home/file.txt /home/x.txt
copy from my machine to a remote machine:
scp /home/x.txt user@192.168.0.1:/home/x.txt
copy all x*.txt from a remote machine to my machine (x01.txt, x02.txt, etc.)
scp “user@192.168.0.1:/home/x*.txt” /home/x.txt
copy a directory from a remote machine to my machine:
scp -r user@192.168.0.1:/home/folder /home/
Comments
One Response to “Simple copy through SSH”
Leave a Reply


To copy from one machine (machine2) to other machine (machine3), but by using a different machine (machine1):
Execute below command in machine1
scp user2@machine2:/path2 user3@machine3:/path3