-
- cp - copy files
-
- cp [ options ] source destination
- cp [ options ] file ... directory
-
- If the last argument names an existing directory, cp copies each file into a file with the same name in that directory. Otherwise, if only two
files are given, cp copies the first onto the second. It is an error if the last argument is not a directory and more than two files are given. By default
directories are not copied.
-
- -a, --archive
- Preserve as much as possible of the structure and attributes of the original files in the copy. Equivalent to --physical
--preserve --recursive.
- -p, --preserve
- Preserve file owner, group, permissions and timestamps.
- -h, --hierarchy|parents
- Form the name of each destination file by appending to the target directory a slash and the specified source file
name. The last argument must be an existing directory. Missing destination directories are created.
- -H, --metaphysical
- Follow command argument symbolic links, otherwise don't follow.
- -l, --link
- Make hard links to destination files instead of copies.
- -L, --logical|dereference
- Follow symbolic links and copy the files they point to.
- -P|d, --physical|nodereference
- Don't follow symbolic links; copy symbolic rather than the files they point to.
- -f, --force
- Replace existing destination files.
- -i, --interactive|prompt
- Prompt whether to replace existing destination files. An affirmative response (y or Y) replaces the
file, a quit response (q or Q) exits immediately, and all other responses skip the file.
- -r|R, --recursive
- Operate on the contents of directories recursively.
- -s, --symlink|symbolic-link
- Make symbolic links to destination files.
- -u, --update
- Replace a destination file only if its modification time is older than the corresponding source file modification time.
- -v, --verbose
- Print the name of each file before operating on it.
- -b, --backup
- Make backups of files that are about to be replaced. See --suffix and --version-control for more information.
- -F, --fsync|sync
- fsync(2) each file after it is copied.
- -S, --backup-suffix|suffix=suffix
- A backup file is made by renaming the file to the same name with the backup suffix appended. The
backup suffix is determined in this order: this option, the SIMPLE_BACKUP_SUFFIX, environment variable, or the default value ~.
- -V, --backup-type|version-control=type
- The backup type is determined in this order: this option, the VERSION_CONTROL environment
variable, or the default value existing. type may be one of:
- numbered|t
- Always make numbered backups. The numbered backup suffix is .SNS, where S is the backup-suffix
and N is the version number, starting at 1, incremented with each version.
- existing|nil
- Make numbered backups of files that already have them, otherwise simple backups.
- simple|never
- Always make simple backups.
- -x|X|l, --xdev|local|mount|one-file-system
- Do not descend into directories in different filesystems than their parents.
-
- pax(1), fsync(2), rename(2),
unlink(2), remove(3)
-
- version
- cp (AT&T Research) 2007-12-13
- author
- Glenn Fowler <gsf@research.att.com>
- author
- David Korn <dgk@research.att.com>
- copyright
- Copyright © 1992-2008 AT&T Intellectual Property
- license
- http://www.opensource.org/licenses/cpl1.0.txt