Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cp(1) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cat(1)

chmod(1)

cpio(1)

mv(1)

rcp(1C)

rm(1)

cp(1)

NAME

cp − copy files

SYNOPSIS

cp [ −i ] [ −p ] file target

cp [ −i ] [ −p ] [ −r ] file ... directory

DESCRIPTION

The cp command copies file to target or files into the target directory. file and target may not have the same name.  (Care must be taken when using sh(1) metacharacters.)  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, or the locale’s equivalent, means that the copy should proceed.  Any other answer prevents cp from overwriting target. 

−p cp not only duplicates the contents of file, but also preserves the modification time and permission modes, ignoring the present umask. 

−r If file is a directory, cp will copy the directory and all its files, including any subdirectories and their files; target must be a directory. 

If target does not exist, cp creates a new file named target which has the same mode as file, modified by the present umask, 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 file are set to the time the copy was made. 

If file 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 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. 

cp refuses to copy a file onto itself. 

SEE ALSO

cat(1), chmod(1), cpio(1), mv(1), rcp(1C), rm(1). 

CX/UX User’s Reference Manual

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026