cp—copies files

cp [options] source dest
cp [options] source… directory

The cp command copies a filename to another target which is either a file or directory. The filename and target cannot have the same name. If the target is not a directory, only one file may be specified before it; if it is a directory, more than one file may be specified. If the target does not exist, cp creates a file named target. If the target exists and is not a directory, its contents are overwritten. If the target is a directory, the file(s) are copied to that directory.

Example A.15.
1  cp --help
2  cp chapter1 book
3  cp -r desktop /usr/bin/tester
				

Explanation

  1. Displays information about cp and its options, and exits.

  2. Copies the contents of file1 to file2.

  3. Copies the contents of chapter1 to the book directory. In the book directory chapter1 has its original name. Recursively copies the entire desktop directory into /usr/bin/tester.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.31.67