Print this article Edit this article

Unix Commands: Using Secure Copy (scp)

Most Unix systems have the scp command installed to copy files between two computer accounts.  It uses ssh for data transfer and provides the same level of security.  Generally you must have an account on both machines. The syntax for scp is:

hostname:pathname

pathname is only needed for remote files. You can copy from a remote computer to the local computer, from the local to a remote, or between two remote computers.

For example, let's copy the file named filename1 from your home directory (cathyc) which is on the computer named harbor. Put the copies into your working directory (.) on the machine you're logged into now, and rename it newfile.

scp cathyc@harbor:filename1 newfile

To copy a directory, you would use scp -r, for example:

scp -r cathyc@harbor:directory1 directory2

Last Modified: Dec 19, 2016 11:12 am US/Eastern
Created: Jun 26, 2007 1:20 pm GMT-4 by admin
JumpURL: