CP(1) RISC/os Reference Manual CP(1)
NAME
cp - copy files
SYNOPSIS
cp [ -i ] [ -p ] [ -r ] file1 [ file2 ...] target
DESCRIPTION
The cp command copies filen to target. filen and target may
not have the same name. (Care must be taken when using
sh(1) metacharacters.) If target is not a directory, only
one file may be specified before it; if it is a directory,
more than one file may be specified. If target does not
exist, cp creates a file named target. If target exists and
is not a directory, its contents are overwritten. If target
is a directory, the file(s) are copied to that directory.
The following options are recognized:
i cp will prompt for confirmation whenever the copy would
overwrite an existing target. A y answer means that
the copy should proceed. Any other answer prevents cp
from overwriting target.
p cp will duplicate not only the contents of filen, but
also preserves the modification time and permission
modes.
r If filen is a directory, cp will copy the directory and
all its files, including any subdirectories and their
files; target must be a directory.
If filen is a directory, target must be a directory in the
same physical file system. target and filen do not have to
share the same parent directory.
If filen is a file and target is a link to another file with
links, the other links remain and target becomes a new file.
If target does not exist, cp creates a new file named target
which has the same mode as filen except that the sticky bit
is not set unless the user is a privileged user; the owner
and group of target are those of the user.
If target is a file, its contents are overwritten, but the
mode, owner, and group associated with it are not changed.
The last modification time of target and the last access
time of filen are set to the time the copy was made.
If target is a directory, then for each file named, a new
file with the same mode is created in the target directory;
the owner and the group are those of the user making the
copy.
Printed 11/19/92 Page 1
CP(1) RISC/os Reference Manual CP(1)
NOTES
Users can mark the end of any command line options using two
dashes, allowing cp to recognize filename arguments that
begin with a single dash. If two dashes and a single dash
both appear on the same command line, the second is inter-
preted as a filename.
SEE ALSO
chmod(1), cpio(1), rm(1).
Page 2 Printed 11/19/92