scp command in linux

SCP: SCP stands for Secure Copy. SCP is used to copy data from one unix/linux sserver to another unix/linux server. SCP uses ssh(secured shell) to transfer the data between the remote hosts.

Features of SCP are:

  • Copies files within the same machine.
  • Copies files from local machine to remote machine
  • Copies files from remote machine to local machine
  • Copies files between two different remote servers

Syntax:

scp [options] [userfrom_host:source_file] [user to_Host:Destionation_File]

Options:

Option Description
-r Recursively
-q progress bar not displayed
-v verbose bar
-p Copy files using port number


Examples

1. Copy File from local host to remote host:

$scp filename root@serverk2.k2schools.com:/root

2. Copy File from remote host to local host:

$scp root@serverk2.k2schools.com:/root/dump*

3. Copy a directory

$scp -r directory root@serverk2.k2schools.com:/root

4. Specifying the port number.

$scp -p 6002 filename root@serverk2.k2schools.com:/root

Improve the performance of scp command: Using blowfish cipher encryption will improves the performance of the scp command.

$scp -c blowfish file root@serverk2.k2schools.com:/root

Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Powered by k2schools
%d bloggers like this: