cp(1) DG/UX R4.11MU05 cp(1)
NAME
cp - copy files
SYNOPSIS
cp [ -i ] [ -p ] [ -r ] file1 [ file2 ...] target
DESCRIPTION
The cp command copies filen to target. filen and target may not have
the same name. (Care must be taken when using sh(1) metacharacters.)
If target is not a directory, only one file may be specified before
it. If it is a directory, more than one file may be specified. If
target does not exist, cp creates a file named target. If target
exists and is not a directory, its contents are overwritten. If
target is a directory, the file(s) are copied to that directory.
The following options are recognized:
-i cp will prompt for confirmation whenever the copy would
overwrite an existing target. A y answer means that the copy
should proceed. Any other answer prevents cp from overwriting
target.
-p cp will preserve the modification time, permission modes and
security attributes of filen by assigning them to target.
Note that the process must have appropriate privilege to
modify target in order for -p to take effect.
-r If filen is a directory, cp will copy the directory and all
its files, including any subdirectories and their files;
target must be a directory.
If filen is a directory, target must be a directory in the same
physical file system. target and filen do not have to share the same
parent directory.
If filen is a file and target is a link to another file with links,
the other links remain and target becomes a new file.
If target does not exist, cp creates a new file named target. On a
trusted system, the process must have MAC write access to target's
parent directory and MAC read access to filen. If the process has
appropriate privilege, then filen's MAC label will be set on target,
otherwise target will have the MAC label of the process. target's
remaining security attributes and mode will be set to those of filen
except that the sticky bit is not set unless the user is a privileged
user; the owner and group of target are those of the user making the
copy. The modification time of target is set to the time the copy
was made unless the -p option is used.
If target is an existing file, its contents are overwritten, but the
mode, security attributes, owner, and group associated with it are
not changed. The last modification time of target and the last
access time of filen are set to the time the copy was made. Note
that the mode, security attributes, and modification time can be
affected by the -p option. On a trusted system, the process must
additionally have MAC write access to target. If the process has
appropriate privilege and filen does not have the same MAC label as
target and target's MAC label does not dominate filen's MAC label,
then cp upgrades target's MAC label to filen's MAC label.
If target is a directory, the files are copied to that directory. For
each filen, cp behaves as described above depending on whether a file
by the same name does or does not already exist in target.
NOTES
A double dash (--) permits the user to mark the end of any command
line options explicitly, thus allowing cp to recognize filename
arguments that begin with a dash (-). If a double dash (--) and a
dash (-) both appear on the same command line, the second will be
interpreted as a filename.
Attempting to copy a FIFO will hang the cp command because cp will
wait on the FIFO for input.
SEE ALSO
chmod(1), cpio(1), getmac(1), rm(1).
Licensed material--property of copyright holder(s)