man.lsPlain-English help for Unix commands

scp Copy files between machines over SSH

Copies files and folders to or from a remote machine using the same encrypted connection and logins as ssh. A remote path is written as user@host:path. Use it for quick one-off copies.

Synopsis

scp [OPTION]... SOURCE... DESTINATION

Common options

Option or formWhat it does
-rCopy folders recursively
-P PORTConnect to PORT on the remote machine. Capital P for scp, unlike ssh -p
-i FILEUse FILE as the private key to log in
-pKeep the original modification times, access times and file modes
-CCompress data in transit. Can help on slow links
-qQuiet mode: hide the progress meter and warnings
-vVerbose mode. Prints debugging messages, useful when a connection fails
-J HOSTConnect through a jump host

Examples

Upload a file to a server's home folder
scp report.pdf user@host:
Download a file from a server
scp user@host:/var/log/app.log .
Upload a whole folder
scp -r photos user@host:/srv/media/
Use a non-standard port and a specific key
scp -P 2222 -i ~/.ssh/id_ed25519 report.pdf user@host:/tmp/
Copy between two remote machines
scp user@host1:/tmp/data.csv user@host2:/tmp/

Notes

See also

Last reviewed 2026-10-07.