What does scp do?

copy files between hosts over SSH.

▸ Explain your own scp command →

scp examples, explained

$ scp -r -P 22 file user@host:/tmp

  • scpcopy files between hosts over SSH
  • -rcopy directories recursively
  • -Pconnect to this port (capital P, unlike ssh)
  • 22value for -P
  • filean argument passed to the command
  • user@host:/tmpan argument passed to the command

scp flags & options

-rcopy directories recursively
-Pconnect to this port (capital P, unlike ssh)
-iuse the given private key file
-ppreserve modification times and modes
-Ccompress data during transfer

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.