scp
Securely copy files between hosts over SSH.
Synopsis
scp [options] source target
Core Options
-P PORTConnect to a custom port.
-i fileUse a specific private key.
-rCopy directories recursively.
-CEnable compression.
-J hostProxyJump via a bastion host.
Usage Examples
Copy to Server
Upload a file.
scp file.txt user@server:/opt/data/Copy from Server
Download a file.
scp user@server:/opt/data/report.csv .Copy Directory
Upload a folder recursively.
scp -r ./logs user@server:/var/tmp/Custom Port & Key
Use a key and non-default port.
scp -i ~/.ssh/id_ed25519 -P 2222 file.txt user@server:/opt/data/Built for builders.