cp.1 (2012 03)

c
cp(1) cp(1)
skipped.
dest_directory should not reside within directory1 , nor should directory1 have a cyclic directory
structure, since in both cases
cp attempts to copy an infinite amount of data.
Under the UNIX Standard environment (see standards (5)),
cp will exit with error if multiple
sources are being copied to a non-existing directory.
-R (recursive subtree copy) The -R option is identical to the
-r option.
With the
-R and -r options, in addition to regular files and directories,
cp also copies FIFOs,
character and block device files and symbolic links. Only superusers can copy device files. All
other users get an error. Symbolic links are copied so the target points to the same location that
the source did.
Warning: While copying a directory tree that has device special files, use the
-r option; other-
wise, an infinite amount of data is read from the device special file and is duplicated as a special
file in the destination directory occupying large file system space.
-H Causes cp to traverse the symbolic link specified as an operand and copy it to the destination.
-L Causes cp to traverse the symbolic link specified as an operand or any symbolic links encoun-
tered during traversal of a file hierarchy, and copy it to the destination.
-P Causes cp to copy the symbolic link specified as an operand and any symbolic links encountered
during traversal of a file hierarchy. This option will not follow any symbolic links.
-e extarg
Specifies the handling of any extent attributes of the file[s] to be copied. extarg takes one of the
following values.
warn Issues a warning message if extent attributes cannot be copied, but copies the
file anyway.
ignore Does not copy the extent attributes.
force Fails to copy the file if the extent attribute can not be copied.
Extent attributes can not be copied if the files are being copied to a file system which does not
support extent attributes or if that file system has a different block size than the original. If
-e
is not specified, the default value for extarg is warn.
-S Specifies "safe" mode. This option minimizes the impact of
cp on the performance of the system
by opening the target file using the
O_DSYNC flag. This is recommended when the total size of
the copy (not of a single file) is a significant portion of the size of system buffer cache. Usage of
this option increases copy time.
-A Causes cp not to copy ACL attributes of the source to destination.
Specifying more than one of the mutually-exclusive options
-H, -L, and -P will not be considered an
error. The last option specified will determine the behavior of the utility.
Access Control Lists (ACLs)
If new_file is a new file, or if a new file is created in dest_directory, it inherits the access control list of the
original file1, file2, etc., altered to reflect any difference in ownership between the two files (see acl (5)
and aclv (5)). In JFS file systems, new files created by
cp do not inherit their parent directory’s default
ACL entries (if any), but instead retain the ACLs of the files being copied. When copying files from a JFS
file system to an HFS file system or vice versa, optional ACL entries are lost.
If
cp is used with the -A option, ACL entries will not be copied to the destination. If the destination file
does not already exits and the -p option is not specified, then the file permission bits of the destination
will be set according to the file creation mask of the user.
EXTERNAL INFLUENCES
For information about the UNIX standard environment, see standards (5).
Environment Variables
LC_CTYPE determines the interpretation of text as single and/or multi-byte characters.
LANG and LC_CTYPE determine the local language equivalent of y (for yes/no queries).
LANG determines the language in which messages are displayed.
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: March 2012