Using the scp command to copy files between Linux systems

scp is very handy for moving files between Linux systems, especially from desktops to embedded systems and vice versa. However, the syntax is always a challenge. For example, to copy a file from a remote system:

scp <username>@<machine>:<full path to file> .

would copy the specified file to the local directory. So for example:

scp pi@192.168.5.26:/home/pi/file fred

would copy some file called file into the local directory as a file called fred. The order can be reversed to send the file the other way.

It’s the ‘:’ that causes all the trouble…

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s