Table of Contents

Linux Commands#network

How to use scp command in Linux (with examples)

secure copy (remote file copy program)



scp options

# scp
usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2
#
# man scp
SYNOPSIS
     scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port]
         [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2


     The options are as follows:
     -p      Preserves modification times, access times, and modes from the original file.

     -r      Recursively copy entire directories.  Note that scp follows symbolic links 
             encountered in the tree traver-sal.

     -i identity_file
             Selects the file from which the identity (private key) for public key authentication is read.

     -l limit
             Limits the used bandwidth, specified in Kbit/s.


Examples

scp test.tar.gz   user1@192.168.0.10:/tmp
scp -rp /tmp/test1/     user1@192.168.0.10:/tmp/test2/

Limit

Command Option bps Bite/s
scp -l 10000 10,000 Kbit/s (10Mbps) 1.2MB/s
scp -l 100000 100,000 Kbit/s (100Mbps) 12MB/s
scp -l 1000000 1,000,000 Kbit/s (1000Mbps) 120MB/s
scp -l 100000  test.tar.gz   user1@192.168.0.10:/tmp    #100Mbps, 12MB/s