scpHow to SCP a directory?
SCP (Secure Copy Protocol) is a secure way to transfer files between two computers. To SCP a directory, you can use the following command:
scp -r <source_directory> <username>@<hostname>:<destination_directory>
This command will copy the <source_directory>
to the <destination_directory>
on the remote host <hostname>
as the user <username>
.
Code explanation
scp
: the command to initiate the SCP process-r
: the flag to indicate that the source is a directory<source_directory>
: the directory to be copied<username>
: the username of the remote host<hostname>
: the hostname of the remote host<destination_directory>
: the directory on the remote host where the source directory will be copied to
Helpful links
More of Scp
- Running SCP in quiet mode
- Is it possible to SCP files in parallel?
- How to show progress when using SCP?
- How to overwrite files using SCP?
- How to transfer files using wildcards with SCP?
- How to use an SSH key when using SCP?
- How to automatically create destination directory when using SCP?
- How to run SCP in verbose mode?
- How to use a different port when using SCP?
- How to use SCP with a password?
See more codes...