O'Reilly logo

A Practical Guide to Red Hat® Linux® 8 by Mark G. Sobell

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

Working with Files

The following sections describe utilities that copy, move, and print files.

cp: Copies a File

The cp (copy) utility makes a copy of a file. This utility can copy any file, including text and executable program (binary) files. You can use cp to make a backup copy of a file or a copy to experiment with.

A cp command line uses the following syntax to specify source and destination files:

							cp source-file destination-file
						

The source-file is the name of the file that cp is going to copy. The destination-file is the name that cp assigns to the resulting—new—copy of the file.

tip || cp Can Destroy a File

If the destination-file exists before you give a cp command, cp overwrites it. Because cp overwrites (and destroys the contents ...

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