Unix Commands: Using Secure Copy (scp)

Body

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

Details

Details

Article ID: 1860
Created
Wed 12/3/25 10:15 AM
Modified
Thu 12/4/25 10:10 AM

Related Services / Offerings

Related Services / Offerings (1)

Submit a General Support request using the "Purdue IT Request" button to the right. The Purdue IT Service Desk will examine, follow-up and route as needed.