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: 2007/11/15 15:26:53.441000 US/Eastern by brian.r.brinegar.1
Created: 2007/06/26 13:20:50.474000 GMT-4 by brian.r.brinegar.1.

Categories

Search

Type in a few keywords describing what information you are looking for in the text box below.

Admin Options: Edit this Document