scp: Secure Copy Protocol — Copy files between local machine and a remote server over SSH. scp copies files between computers over SSH. scp backup.sql user@server:/tmp/ uploads a file, and scp user@server:/var/log/app.log . downloads one. Add -r for folders. It uses the same keys and login as ssh, so if you can log in, you can copy.
For anything beyond the occasional file, rsync over SSH is usually better. It only sends what changed, can resume interrupted transfers and shows progress. Recent OpenSSH versions also run scp on top of the SFTP protocol, which fixed some long-standing quirks. Be careful with what you copy around: database dumps and log files often contain personal data, and copies on laptops and in temporary folders are easily forgotten.
Use before running or suggesting shell commands with flags, especially destructive or broad ones (-f/--force, -r/-R recursive, -a/--all, -y/--yes, prune, --hard), and when a user asks what a flag means (-v, -q, -n/--dry-run, -h, -o, -p, -t, -u, -w, -x, -c, -i). Explains flags per tool and prefers dry runs and narrow scopes.
Use when an HTTP request returns an unexpected status code (4xx or 5xx, or a redirect loop), when a user pastes an error like "419 Page Expired", "422 Unprocessable Content", "502 Bad Gateway" or "CORS error", or when debugging API calls between a frontend and a Laravel/PHP or Node backend. Finds the cause from the status code, headers and logs before changing code.