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@ 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…