O'Reilly logo

Learning Unix for Mac OS X Tiger by Dave Taylor

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Transferring Files

You may need to copy files between computers. For instance, you can put a backup copy of an important file you're editing onto an account at a computer in another building or another city. Or, Dr. Nelson could copy a file from her local computer onto a central computer, where her colleagues can access it. Or you might want to download 20 files from an FTP server, but don't want to go through the tedious process of clicking on them one by one in a web browser.

If you need to do this sort of thing often, you may be able to set up a networked filesystem connection; then you'll be able to use the Finder or local programs such as cpand mv to help you move files around on your own system. But Unix systems also have command-line tools such as scpand rcpfor transferring files between computers. These often work more quickly than most graphical applications, and believe it or not, they're pretty easy to use, as we'll explore in this section.

scp and rcp

Mac OS X includes both scp(secure copy) and rcp(remote copy) programs for copying files between two computers. In general, you must have accounts on both computers to use these commands. The syntax of scpand rcpare similar to cp, but they also let you add the remote hostname to the start of a file or directory pathname. The syntax of each argument is:

hostname:pathname

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required