.TH CP 1 .SH NAME cp, cpdir \- file copy .SH SYNOPSIS \fBcp [\fB\-pifsmrRvx\fR] \fIfile1\fR \fIfile2\fR\fR .br \fBcp [\fB\-pifsrRvx\fR] \fIfile\fR ... \fIdirectory\fR\fR .br \fBcpdir [\fB\-ifvx\fR] \fIfile1\fR \fIfile2\fR\fR .br .de FL .TP \\fB\\$1\\fR \\$2 .. .de EX .TP 20 \\fB\\$1\\fR # \\$2 .. .SH OPTIONS .FL "\-p" "Preserve full mode, uid, gid and times" .FL "\-i" "Ask before removing existing file" .FL "\-f" "Forced remove existing file" .FL "\-s" "Make similar, copy some attributes" .FL "\-m" "Merge trees, disable the into-a-directory trick" .FL "\-r" "Copy directory trees with link structure, etc. intact" .FL "\-R" "Copy directory trees and treat special files as ordinary" .FL "\-v" "Display what cp is doing" .FL "\-x" "Do not cross device boundaries" .SH EXAMPLES .EX "cp oldfile newfile" "Copy \fIoldfile\fR to \fInewfile\fR" .EX "cp -R dir1 dir2" "Copy a directory tree" .SH DESCRIPTION .PP .I Cp copies one file to another, or copies one or more files to a directory. Special files are normally opened and read, unless \fB\-r\fP is used. \fB\-r\fP also copies the link structure, something \fB\-R\fP doesn't care about. The \fB\-s\fP option differs from \fB\-p\fP that it only copies the times if the target file already exists. A normal copy only copies the mode of the file, with the file creation mask applied. Set-uid bits are cleared if the owner cannot be set. (The \fB\-s\fP flag does not patronize you by clearing bits. Alas \fB\-s\fP and \fB\-r\fP are nonstandard.) .PP .I Cpdir is a convenient synonym for \fBcp \-psmr\fP to make a precise copy of a directory tree. .SH "SEE ALSO" .BR cat (1), .BR mkdir (1), .BR rmdir (1), .BR ln (1), .BR rm (1).