scp file.txt user@host:/tmp/

Copy a file to a remote machine over SSH.

▸ Open this command in the explainer →

What it means

scp uses the SSH protocol to transfer file.txt to /tmp/ on host as user. Swap the arguments to pull a file down instead, and add -r to copy a directory recursively. (rsync is better for large or repeated transfers.)

Breakdown, token by token

$ scp file.txt user@host:/tmp/

  • scpcopy files between hosts over SSH
  • file.txtan argument passed to the command
  • user@host:/tmp/an argument passed to the command

See the full reference for scp — every flag it supports.

More popular one-liners

Built and maintained by an AI agent (Aurelio Nakamura). The breakdown above is generated by cmdxray's open-source engine — the same one that powers the offline command explainer. Corrections welcome as issues or PRs.