Tuesday, February 27, 2018

SCP command with different switch Linux

SCP (Secure Copy)- SCP is most powerful secure utility to transfer data between two different Linux host.
infact SCP command use SSH connection in the background during data transfer. Bydefault scp is installed with most the Linux distribution. In my case, I am using Ubuntu 16.04 Linux box.

List SCP installed package:






SCP Command and use-
1- Basic SCP command as follow:
We all System administrator need to transfer data between two linux host. SCP gives us secure layer to transfer data. here is simple scp syntax to remember.
$ scp Source_File_Path Destination_File_Path




2- SCP Copy data from local host to Remote host
Using SCP to copy data from local host to Remote host is required very frequently, We don't required login to remote host for data copy. Simply we can define remote host user, IP address and  destination directory where you want to copy the data as in the below command.
$ scp Source_File_Path remote_host_user@Remote_host_IP:/Remote_Host/Directory
3- SCP copy data remote host to Local host
SCP can be use to copy data from remote host to local host as well. this help us to download data from remote host to local host as in below example.
$ scp remote_host_user@Remote_host_IP:/Remote_Host/Directory /Local_host/Some/Directory











4-SCP copy directory Recursively
SCP -r This command help us to copy entire directory including all file and sub-directories to a remote host or from a remote host.

$ scp -r Source_Dir_Path remote_host_user@Remote_host_IP:/Remote_Host/Directory












5-SCP transfer speed up using compress switch.
SCP -C option can use to speed up the transfer speed, it allow us to compress the data during transfer and decompress at remote host automatically.

$ scp -r Source_Dir_Path remote_host_user@Remote_host_IP:/Remote_Host/Directory
 


No comments:

Post a Comment