SCP stands for Secure Copy, as the name shows it use for securely copy the file, directory from one location to another.
SCP use to copy files securely between networks and system/servers. It uses SSH protocol for authentication and data transfer.
SCP command Syntax:
As per the requirement, we can use hostname, port, username, and password with SCP command options.
Here some examples of SCP command which will help you to understand the real use of SCP command.
Suggested Reading: Linux sed command Structure
SCP Command Examples:
Copy a file to remote system
To copy a file into the remote server, you can use source and destination path.
The above command will copy a linuxconcept.pdf file into satish’s home directory at “linuxconcept.com” system.
Get the detailed information while coping
There is an option “-v” to use to get detailed information while copying the file between host. The option “-v” is used to execute SCP command in verbose mode so that it will print debug information into the screen.
Use specific Port with SCP to connect remote host
To use a specific port with SCP command, you can use the “-P” option, as shown below: