Copying Files over the Network with scp

To ”’send”’ file or directory ”’to a remote computer”’:
scp -r [/path/filename] [login name@ip address] :

To ”’retrieve”’ file or directory ”’from a remote computer”’  ”’address in your pc”’:
scp -r [login name@ip address] : [/path/filename]  [/path/filename]

Here are the meaning of scp command options:

-r — recursively copy entire directory
. — current directory

Examples:

To copy all txt files in the current directory to your home directory on the destination machine:
scp *.txt 192.168.1.100:

To copy txt files to a destination directory. You have to have write permission on the target directory:
scp *.txt 192.168.1.100:/home/username/directory

To retrieve files from the other machine back to the one you’re on:
scp 192.168.1.100:*.txt /home/support/Desktop

You may also like