cp(1)
NAME
cp − copy file data
SYNTAX
cp [−i] file1 file2
cp [−i] [−r] directory... directory
DESCRIPTION
The cp command copies file1 onto file2. The mode and owner of file2 are preserved if it already existed; the mode of the source file is used otherwise.
In the second form, one or more files are copied into the directory with their original file-names.
The cp command refuses to copy a file onto itself.
OPTIONS
−iPrompts user with the name of file whenever the copy will cause an old file to be overwritten. An answer of ’y’ will cause cp to continue. Any other answer will prevent it from overwriting the file..
−rCopies directories. Entire directory trees, including their subtrees and the individual files they contain, are copied to the specified destination directory. The directory, its subtrees, and the individual files retain their original names. For example, to copy the directory reports, including all of its subtrees and files, into the directory news, type the following command:
cp -r report news
You can not use the −r option for file to file copies.
RESTRICTIONS
When using the −r option, the directories must have different names.
SEE ALSO
Commands