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
- How to use SCP with a password?
- How to run SCP in verbose mode?
- How to transfer files recursively using SCP?
- Running SCP in quiet mode
- How to show progress when using SCP?
- How to use an SSH key when using SCP?
- How to SCP to multiple hosts?
- How to automatically create destination directory when using SCP?
- How to overwrite files using SCP?
- How to SCP multiple files?
See more codes...