| linux version BSD down there cp - copy files and directories
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
ENVIRONMENT
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
cp [-R [-H|-L|-P]] [-f|-i|-n]
[-v] [-p]
| |||||||||||||||||||||
An attempt to copy a file to itself fails.
-v | verbose, showing files as they are copied.
| ||||||||||||||||||
| |||||||||||||||||||
-p | preserve the modification time, access time, file flags, this is not the default an alias cp='cp -p' is frequently entered into .profile File mode is preserved without specifing -p.If the user ID and group ID cannot be preserved, no error message is displayed and the exit value is not affected ( ex: cp /user/you/file mycopy )If the source file has both "set user ID" and "set group ID" and either cannot be preserved, neither bits are preserved.
If the destination file exists, its contents are overwritten, but its mode, user ID, and group ID are unchanged unless | ||||||||||||||||||
-R Recursively copy the directory and the entire subtree. | Created directories have the same mode as the corresponding source directory. Symbolic links are copied, rather than indirected through. Hard linked files are copied multiple times as separate files. This causes additional space to be required and the files in the destination directory are not longer linked. To preserve hard links, use tar, cpio, or pax . New special files are created rather than copying them as normal files.
|
|
| ||||||||||||||||
cp file directory form, target_directory must exist,
unless
a directory is the source and -R is specified.
If the destination file does not exist, the mode of the source file is
used as modified by the file mode creation mask (umask, see csh).
If the source file has its set user ID bit on, that bit is removed unless
both the source file and the destination file are owned by the same user.
If the source file has its set group ID bit on, that bit is removed
unless both the source file and the destination file are in the same
group and the user is a member of that group.
If both the set user ID
and set group ID bits are set, all of the above conditions must be fulfilled or both bits are removed.
Appropriate permissions are required for file creation or overwriting.
Symbolic links are followed unless -R is set.
-H or -L (in conjunction with -R)
cause symbolic links to be followed as described above.
-H, -L and -P are ignored unless -R
is specified.
These options override each other and the last one specified is used.
exits 0 on success, and >0 if an error occurs.
See mv, rcp, umask, fts, symlink
CP BSD July 23, 2002