e14e0becce
The -d option is a GNU extension and is equivalent to its "-P --preserve=links" options. Since we don't implement the --preserve=links functionality anyway (it means preserve hard links between files), just call it -P, which is specified by POSIX. Additionally, there is no need to check for cp_Pflag again before copying the symlink itself because the only way the mode in the stat will indicate a symlink is if we used lstat (which we only do if -P is specified).
43 lines
845 B
Groff
43 lines
845 B
Groff
.TH CP 1 sbase\-VERSION
|
|
.SH NAME
|
|
cp \- copy files and directories
|
|
.SH SYNOPSIS
|
|
.B cp
|
|
.RB [ \-Rr ]
|
|
.I file
|
|
.RI [ name ]
|
|
.P
|
|
.B cp
|
|
.RB [ \-aPpRrv ]
|
|
.RI [ file ...]
|
|
.RI [ directory ]
|
|
.SH DESCRIPTION
|
|
.B cp
|
|
copies a given file, naming it the given name. If multiple files are listed
|
|
they will be copied into the given directory.
|
|
.SH OPTIONS
|
|
.TP
|
|
.B \-a
|
|
preserve mode, timestamp, links and permissions.
|
|
Implies \-d, \-p, \-r.
|
|
.TP
|
|
.B \-P
|
|
don't dereference symbolic links.
|
|
.TP
|
|
.B \-p
|
|
preserve mode, timestamp and permissions.
|
|
.TP
|
|
.B \-f
|
|
if an existing destination file cannot be opened, remove it and try again.
|
|
.TP
|
|
.B \-R
|
|
equivalent to -r.
|
|
.TP
|
|
.B \-r
|
|
copies directories recursively. If this flag is not specified, directories are
|
|
not copied.
|
|
.TP
|
|
.B \-v
|
|
print names of source and destination per file to stdout. In the format:
|
|
"source \-> destination".
|