Copy one local file to a remote host with SCP
Build a paste-ready command, then review its compatibility and effects before running it.
scp -P 22 <local-file> <username>@<host>:<remote-path>Complete required fields to copy the generated command.
Compatibility
Linux + macOSVerified for Linux, macOS using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementsscpscp must be installed and available on PATH.Network accessThe target must be reachable from the current environment.
Version supportscp Current supported releasesVerified for linux, macos using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsrelease.tar.gz 100% 43MB 18.4MB/s 00:02Representative successful output; values vary with the selected target and system state.
Known errorsscp: command not foundscp is missing or is not available on PATH.
Verifyscp -P {{port}} {{localFile}} {{user}}@{{host}}:{{remotePath}}Re-run the corresponding read-only inspection and confirm the intended state.Rollback noteNo universal automatic rollback is available. Capture the current state and use the tool-specific recovery procedure before applying changes.
Command breakdown
01scpCommandRuns the scp stage of this one-liner.
02-POptionConnects to the SSH server on the specified port.
03<port>ParameterA value supplied in the Fill parameters section.
04<local-file>ParameterA value supplied in the Fill parameters section.
05<username>@ParameterA value supplied in the Fill parameters section.
06<host>:ParameterA value supplied in the Fill parameters section.
07<remote-path>ParameterA value supplied in the Fill parameters section.
Example input
scp -P 22 release.tar.gz deploy@app01.example.com:/srv/releases/
Example output
release.tar.gz 100% 43MB 18.4MB/s 00:02
Illustrative output — exact values vary by system and data.
Official sources
Related commands