COPY(1) INTERACTIVE UNIX System COPY(1)
NAME
copy - copy groups of files
SYNOPSIS
copy [ option ] ... source ... dest
DESCRIPTION
The copy command copies the contents of directories to
another directory. It is possible to copy whole file sys-
tems since directories are made when needed.
If files, directories, or special files do not exist at the
destination, then they are created with the same modes and
flags as the source. In addition, the super-user may set
the user and group ID. The owner and mode are not changed
if the destination file exists. Note that there may be more
than one source directory. If so, the effect is the same as
if the copy command had been issued for each source direc-
tory with the same destination directory for each copy.
All options must be given as separate arguments, and they
may appear in any order. The options are:
-a Asks the user before attempting a copy. If the
response does not begin with a ``y'', then a copy is
not done. This option also sets the -ad option.
-l Uses links instead whenever they can be used. Oth-
erwise, a copy is done. Note that links are never
done for special files or directories.
-n Requires the destination file to be new. If not,
then the copy command does not change the destina-
tion file. The -n flag is meaningless for direc-
tories. For special files, an -n flag is assumed
(i.e., the destination of a special file must not
exist).
-o If set then every file copied has its owner and
group set to those of the source. If not set, then
the file's owner is the user who invoked the pro-
gram.
-m If set, then every file copied has its modification
time and access time set to that of the source. If
not set, then the modification time is set to the
time of the copy.
-r If set, then every directory is recursively examined
as it is encountered. If not set, then any direc-
tories that are found are ignored.
-ad Asks the user whether an -r flag applies when a
Rev. Base System Page 1
COPY(1) INTERACTIVE UNIX System COPY(1)
directory is discovered. If the answer does not
begin with a ``y'', then the directory is ignored.
-v If the verbose option is set, messages are printed
that reveal what the program is doing.
source This may be a file, directory, or special file. It
must exist. If it is not a directory, then the
results of the command are the same as for the cp
command.
dest The destination must be either a file or directory
that is different from the source.
If source and destination are anything but directories, then
copy acts just like a cp command. If both are directories,
then copy copies each file into the destination directory
according to the flags that have been set.
SEE ALSO
chmod(1), cp(1).
NOTES
Special device files can be copied. When they are copied,
any data associated with the specified device is not copied.
Rev. Base System Page 2