DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

copy(1)


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 systems 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 directory with the same destination directory for each copy.

Command options

All of the options must be given as separate arguments, and they may appear in any order even after the other arguments.

-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. Otherwise 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 destination file. The -n flag is meaningless for directories. For special files an -n flag is assumed (that is, 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 source. If not set, then the file's owner is the user who invoked the program.

-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 directories that are found are ignored.

-ad
Asks the user whether an -r flag applies when a 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.

Notices

Special device files can be copied. When they are copied, any data associated with the specified device is not copied.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004