Skip to main content
Kill -9 Club
Sign in

scp

SSHPackage: openssh-client

Copies files over SSH, with cp's syntax. Enough for one file; for a tree to keep in sync, rsync copies only what changed.

What its options do in the lessons

From the same glossary the lessons render under their commands, so the two cannot disagree.

scp -r
Copies a directory and its contents.
scp -P
The remote SSH port — capital, where ssh uses lowercase -p. The mistake is common precisely because scp -p also exists and means something else entirely.
scp -p
Preserves the original file’s timestamps and permissions.
scp -O
Forces the old SCP protocol. Since OpenSSH 9.0 scp transfers over SFTP; this is only needed against a server too old to understand that, which is why it turns up in old advice copied forward.

Lessons that teach it