scp is one of the most useful tools to keep around when you need to move files between machines over SSH.
I used it often for backups, quick transfers, and one-off server work where a heavier sync tool was unnecessary.
Basic form
| |
That is enough for many everyday cases.
Download multiple files
If a remote server named google-server.com has twitter.txt and facebook.txt under /home/cliper/, you can download both in one command like this:
| |
Download a single file
| |
Upload a file
If you want to upload a local file to server1.com:
| |
There are plenty of other tools for transfer and synchronization, such as rsync, wget, or Git depending on the job, but scp remains a very handy option for fast direct copies.