This will be short article with a quick hint. I wanted to write it, because I often get asked how to easily transfer files from a machine to another. Of course you could just upload a file to dropbox and download it on the other machine, but for this method you can transfer files to a headless system easily and without having to physically access the remote computer, which is quite handy if the remote computer is somewhere else than you are.
Sometimes you need to transfer files from one computer to another. The simples way of sending files between computers in your home network is using SCP (secure copy). For those of you, who use a UNIX based system, SCP is already built into your system. I often have to transfer files from my macintosh computer to a Raspberry Pi or BeagleBone, so using SCP comes in very handy for me. This page is intended to be a quick and very short reference for secure copy. For more details, visit the scp man page.
If you are using windows, there is an alternative for you below!
UNIX
The SCP command copies a local file to a remote computer:
scp <local_file> <remote_user>@<remote_machine>:<remote_path>
For example:
scp ~/cat.jpg pi@192.168.188.20:~
This will copy the file cat.jpg to the remote user’s (pi’s) home directory on the machine with the ip-address 192.168.188.20.
If you want to transfer a remote file to your local machine, use:
scp <remote_user>@<remote_machine>:<remote_path> <local_path>
Windows
If you are using windows, there are alternatives like WinSCP, which combines different protocols and functionalities into a handy app for windows. Alternatively you can install a linux bash on windows.
Ah! The good old scp! Has never disappointed me.
LikeLiked by 2 people