📅  最后修改于: 2023-12-03 14:47:18.760000             🧑  作者: Mango
SCP (Secure Copy) is a command-line utility in Unix and Linux systems that allows you to securely transfer files between machines. It uses SSH (Secure Shell) protocol to encrypt the data being transferred and ensure secure communication between machines.
The syntax of SCP is similar to the syntax of the cp
command used to copy files locally.
scp [options] [source] [destination]
Here, source
specifies the file or directory to be copied, and destination
specifies the location where the file or directory should be copied to.
-P
option specifies the port number on which the remote machine is running the SSH server.-r
option is used when copying a directory and its contents along with all subdirectories recursively.-q
option suppresses the progress meter and warning messages.-p
option preserves the modification times, access times, and modes of the original file or directory.scp /path/to/local/file username@remote:/path/to/destination/folder
scp username@remote:/path/to/remote/file /path/to/destination/folder
scp -r /path/to/local/directory/ username@remote:/path/to/destination/folder
scp -r username@remote:/path/to/remote/directory/ /path/to/destination/folder
SCP is a reliable and secure way to transfer files between machines. It allows you to transfer files and directories from one machine to another quickly and easily. The encryption provided by SSH ensures that your data remains private and secure during the transfer.