SCP for copying data

SCP (Secure Copy)

The ‘SCP’ command is recommended to copy data to and from different machines, whether that is a local to/from remote machine, or remote machine to remote machine. Data transfers can be made with one command with SCP always expecting the ‘from’ location first followed by the ‘to’ destination. Depending on which remote machine you are currently logged into, you will prefix your username and server to one of the locations.

 scp [username@server:][location of file] [destination of file]

or

 scp [location of file] [username@server:][destination of file]

** To copy a directory/folder, you need to use the ‘-r’ flag, i.e.:

 scp -r [location of file] [username@server:][destination of file]

 

Examples

Below are some common examples of SCP usage at HIE:

  1. Transfer of data from hie-storage to local (mac or linux) computer

 scp -r jon.smith@hie-storage.intersect.org.au:/data/hiestorage/WorkingData/HIE_LAB/PROJECTS/MyProject/Share/MyDataFolder /home/jonsmith/
Password:
MyDataFolder 100% 9664KB 508.6KB/s 00:19

This copies the folder ‘MyDataFolder’ from the remote hie-storage machine to the /home/jonsmith/ directory on the local computer.