Name
cp
Synopsis
cp [options]file1 file2cp [options]filesdirectory
Copy file1 to
file2, or copy one or more
files to the same names under
directory. If the destination is an existing
file, the file is overwritten; if the destination is an existing
directory, the file is copied into the directory (the directory is
not overwritten). If one of the inputs is a
directory, use the -r option.
Common Options
-f,--forceRemove existing files in the destination.
-i,--interactivePrompt for confirmation (
yfor yes) before overwriting an existing file.-
-p Preserve the original file’s permissions, ownership, and timestamps in the new file.
-r,-R,--recursiveCopy directories recursively. Solaris
-Rreplicates named pipes, instead of reading from them.
GNU/Linux and Mac OS X Options
-
-H When used with
-R, if a command-line argument is a symbolic link to a directory, recursively traverse the directory.-L,--dereferenceWhen used with
-R, if any symbolic link points to a directory, recursively traverse the directory.-
-P When used with
-R, do not follow any symbolic links. This is the default.-v,--verboseBefore copying , print the name of each file.
Solaris Option
-
-@ Copy extended attributes (ACLs, etc.) along with normal attributes.
GNU/Linux Options
-a,--archivePreserve attributes of original files where possible. The same as
-dpR.-
-b Back up files that would otherwise be overwritten.
--backup[=backup-method]Like
-b, but accepts an additional specification controlling how the backup copy should be made. ...