CP(1) SysV CP(1)
NAME
cp - copy files
SYNOPSIS
cp [ -CcfiopPsv ] file1 file2
cp [ -CcfiopPrsv ] file ... directory
DESCRIPTION
cp copies file1 onto file2. By default, cp preserves the mode and owner
of file2 if file2 already exists; otherwise it uses the mode of the
source file modified by the current umask (1) is used.
In the second form, one or more files are copied into the directory with
their original filenames.
cp will not copy a file onto itself.
OPTIONS
-i Prompt the user with the filename whenever the copy will cause
an old file to be overwritten. An answer of 'y' causes cp to
continue. Any other answer prevents it from overwriting the
file.
-p Attempt to preserve (duplicate) in copies the modification
times and modes of the source files, ignoring the present
umask.
-r The behavior of the -r option is dependent upon the existence
of the directories named in the cp command.
If the destination directory exists at the time of execution,
cp will create a new directory beneath the destination
directory using the name of the source directory. The contents
of the source directory will then be copied into this new
directory.
If the destination directory does not exist at the time of
execution, cp will create the directory with the destination
name, and copy the contents of the source directory there.
Domain/OS SysV OPTIONS
-C Change the names of any existing files which would have been
overwritten. The current date is appended to the filename, in
the format @mm.dd[.n]. If this name already exists, an
additional number is appended. If you specify the -C option,
the files copied in will not adopt the mode and owner of the
existing files.
-c Change the names of any existing files which would have been
overwritten. The current date is appended to the filename, in
the format .mm.dd[.n]. If this name already exists, an
additional number is appended. If you specify the -c option,
the files copied in do not adopt the mode and owner of the
existing files.
-f Force locked files to be overwritten, and mark the overwritten
files to be deleted when they become unlocked. If you specify
the -f option, the files copied in do not adopt the mode and
owner of the existing files.
-o Copy each file as a typed object, without attempting to open a
stream to the file. This is useful in cases where opening a
stream would succeed, but not yield the entirety of the
underlying object.
-s Treat symbolic links as files to be copied, rather than copying
the destination of the link. This is especially useful when
the -r option is used to copy an entire directory tree that may
contain links to other file systems.
-v Print the name of each file copied, on the standard output
(verbose).
-P Attempt to preserve any extended access control list (ACL) on
the source files, ignoring both the present umask and the
destination ACL.
SEE ALSO
cat(1), cpacl(1), mv(1), rcp(1C), acl(5)