cp

Name

cp -- copy files and directories

Synopsis

Description

cp is as specified in the SUS but with differences as listed below.

LSB Deprecated Differences

The behaviors specified in this section are expected to disappear from a future version of the LSB; applications should only use the non-LSB-deprecated behaviors.

-a archive

is the same as -dpR.

--backup[=CONTROL]

makes a backup of each existing destination file.

-b

is like --backup but does not accept an argument.

-d, --no-dereference

never follows symbolic links.

-H

follows command-line symbolic links.

-l, --link

links files instead of copying.

-L, --dereference

always follows symbolic links.

--parents

appends source path to DIRECTORY.

--remove-destination

removes each existing destination file before attempting to open it. (Contrast with --force.)

--sparse=WHEN

controls creation of sparse files.

By default, sparse SOURCE files are detected by a crude heuristic and the corresponding DEST file is made sparse as well. That is the behavior selected by --sparse=auto. Specify --sparse=always to create a sparse DEST file whenever the SOURCE file contains a long enough sequence of zero bytes. Use --sparse=never to inhibit creation of sparse files.

--strip-trailing-slashes

removes any trailing slashes from each SOURCE argument.

-s, --symbolic-link

makes symbolic links instead of copying.

-S, --suffix=SUFFIX

overrides the usual backup suffix.

--target-directory=DIRECTORY

moves all SOURCE arguments into DIRECTORY.

-u, --update

copies only when the SOURCE file is newer than the destination file or when the destination file is missing.

-v, --verbose

explains what is being done.

-x, --one-file-system

stays on this file system.

--version

outputs version information and exits.