Name
cp — stdin stdout - file -- opt --help --version
Synopsis
cp [options]files(file|directory)
The cp command normally
copies a file:
$ cp file file2
or copies multiple files into a directory:
$ cp file1 file2 file3 file4 destination_directoryUsing the -a option, you
can also recursively copy directories.
Useful options
|
|
Copy not only the file contents, but also the file’s permissions, timestamps and, if you have sufficient permission to do so, its owner and group. (Normally the copies will be owned by you, timestamped now, with permissions set by applying your umask to the original permissions.) |
|
|
Copy a directory hierarchy recursively, preserving all file attributes and links. |
|
|
Copy a directory hierarchy recursively. This option does not preserve the files’ attributes such as permissions and timestamps. It does preserve symbolic links. |
|
|
Interactive mode. Ask before overwriting destination files. |
|
|
Force the copy. If a destination file exists, overwrite it unconditionally. |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access