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]


 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]



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 /home/jonsmith/
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.