CP(1) COMMAND REFERENCE CP(1)
NAME
cp - copy
SYNOPSIS
cp [ -i ] [ -p ] filename1 filename2
cp [ -i ] [ -p ] [ -r ] filename ... directory
DESCRIPTION
Filename1 is copied onto filename2. The mode and owner of
filename2 are preserved if it already existed; otherwise the
mode of the source file modified by the current umask is
used. The -p option causes cp to attempt to preserve
(duplicate) in its copies the modification times and modes
of the source files, ignoring the present umask. Set uid
bits are not preserved unless the -p option is used.
In the second form, one or more filenames are copied into
the directory with their original file-names.
Cp refuses to copy a file onto itself.
OPTIONS
-i Cp will prompt the user with the name of the file
whenever the copy will cause an old file to be
overwritten. An answer of y will cause cp to continue.
Any other answer will prevent it from overwriting the
file.
-p Preserve the modification times and modes of the source
files.
-r If any of the source files are directories, cp copies
each subtree rooted at that name; in this case the
destination must be a directory.
EXAMPLES
The following invocation will copy all the files in the
current directory beginning with the letters xyz to the
directory mhl.
cp xyz* mhl
RETURN VALUE
[NO_ERRS] Command completed without error.
[USAGE] Incorrect command line syntax. Execution
terminated.
[NP_WARN] An error warranting a warning message
occurred. Execution continues.
Printed 10/17/86 1
CP(1) COMMAND REFERENCE CP(1)
[P_WARN] A system error occurred. Execution continues.
See intro(2) for more information on system
errors.
[P_ERR] A system error occurred. Execution
terminated. See intro(2) for more
information on system errors.
CAVEATS
Copying a directory without the -r option causes a file to
be created which contains the same data as the directory,
but which is not a directory. A warning is printed if this
happens.
The -i option for cp is not the same as that for rm.
SEE ALSO
cat(1), cpio(1), mv(1), pr(1), rcp(1n), rm(1), sh(1sh).
Printed 10/17/86 2
%%index%%
na:72,45;
sy:117,307;
de:424,825;
op:1249,634;
ex:1883,235;
rv:2118,337;2599,344;
ca:2943,369;
se:3312,202;
%%index%%000000000141