O'Reilly logo

SAMS Teach Yourself Unix in 10 Minutes by Robert Shimonski

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

The cp Command

When you want to make a copy of a file, you can use the cp command. The cp command will allow you to copy a single file to a new destination file, or copy one or more files to a single destination directory. This file operation will come up many times in your workings with Unix. It's not uncommon to want to make copies of files you are working on. If you wanted to make a quick backup copy of a file, this command could help you do that.

To use the cp command to make a copy of a single file, follow these steps:

1.
Determine the source filename, and the destination filename to which you'd like to copy the file.
2.
Issue the cp command as cp <sourcefile> <destinationfile>.

There will be times where you may not have just one file, but ...

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