Name
scp — stdin stdout - file -- opt --help --version
Synopsis
scp local_spec remote_specThe scp (secure copy)
command copies files and directories from one computer to another in
batch. (For an interactive user interface, see sftp.) It encrypts all communication
between the two machines. As a simple example, scp can copy a local file to a remote
machine:
$ scp myfile remote.example.com:newfile
recursively copy a directory to a remote machine:
$ scp -r mydir remote.example.com:
copy a remote file to your local machine:
$ scp remote.example.com:myfile .
or recursively copy a remote directory to your local machine:
$ scp -r remote.example.com:mydir .
To specify an alternate username on the remote system, use the
username@host
syntax:
$ scp myfile smith@remote.example.com:
Useful options
|
|
Duplicate all file attributes (permissions, timestamps) when copying. |
|
|
Recursively copy a directory and its contents. |
|
|
Produce verbose output, useful for debugging. |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access