Linux: Secure file copy between hosts using scp command

2012-06-28 Linux

Secure file copy allows you to copy files between two hosts in a secured way. Below I posted some basic usage of this useful command.


From local to remote

scp source_file [email protected]:/directory/target_file
scp db_dump.tar.gz [email protected]:/backups/db_dump.tar.gz

From remote to local

scp [email protected]:/directory/source_file target_file
scp [email protected]:/backups/db_dump.tar.gz db_dump.tar.gz

Keep in mind that the above syntax of Scp command, works perfectly on OS X.