1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3.
2 .TH CP "1" "January 2016" "GNU coreutils 8.25" "User Commands"
4 cp \- copy files and directories
7 [\fI\,OPTION\/\fR]... [\fI\,-T\/\fR] \fI\,SOURCE DEST\/\fR
10 [\fI\,OPTION\/\fR]... \fI\,SOURCE\/\fR... \fI\,DIRECTORY\/\fR
13 [\fI\,OPTION\/\fR]... \fI\,-t DIRECTORY SOURCE\/\fR...
15 .\" Add any additional description here
17 Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
19 Mandatory arguments to long options are mandatory for short options too.
21 \fB\-a\fR, \fB\-\-archive\fR
22 same as \fB\-dR\fR \fB\-\-preserve\fR=\fI\,all\/\fR
24 \fB\-\-attributes\-only\fR
25 don't copy the file data, just the attributes
27 \fB\-\-backup\fR[=\fI\,CONTROL\/\fR]
28 make a backup of each existing destination file
31 like \fB\-\-backup\fR but does not accept an argument
33 \fB\-\-copy\-contents\fR
34 copy contents of special files when recursive
37 same as \fB\-\-no\-dereference\fR \fB\-\-preserve\fR=\fI\,links\/\fR
39 \fB\-f\fR, \fB\-\-force\fR
40 if an existing destination file cannot be
41 opened, remove it and try again (this option
42 is ignored when the \fB\-n\fR option is also used)
44 \fB\-i\fR, \fB\-\-interactive\fR
45 prompt before overwrite (overrides a previous \fB\-n\fR
49 follow command\-line symbolic links in SOURCE
51 \fB\-l\fR, \fB\-\-link\fR
52 hard link files instead of copying
54 \fB\-L\fR, \fB\-\-dereference\fR
55 always follow symbolic links in SOURCE
57 \fB\-n\fR, \fB\-\-no\-clobber\fR
58 do not overwrite an existing file (overrides
59 a previous \fB\-i\fR option)
61 \fB\-P\fR, \fB\-\-no\-dereference\fR
62 never follow symbolic links in SOURCE
65 same as \fB\-\-preserve\fR=\fI\,mode\/\fR,ownership,timestamps
67 \fB\-\-preserve\fR[=\fI\,ATTR_LIST\/\fR]
68 preserve the specified attributes (default:
69 mode,ownership,timestamps), if possible
70 additional attributes: context, links, xattr,
73 \fB\-\-no\-preserve\fR=\fI\,ATTR_LIST\/\fR
74 don't preserve the specified attributes
77 use full source file name under DIRECTORY
79 \fB\-R\fR, \fB\-r\fR, \fB\-\-recursive\fR
80 copy directories recursively
82 \fB\-\-reflink\fR[=\fI\,WHEN\/\fR]
83 control clone/CoW copies. See below
85 \fB\-\-remove\-destination\fR
86 remove each existing destination file before
87 attempting to open it (contrast with \fB\-\-force\fR)
89 \fB\-\-sparse\fR=\fI\,WHEN\/\fR
90 control creation of sparse files. See below
92 \fB\-\-strip\-trailing\-slashes\fR
93 remove any trailing slashes from each SOURCE
96 \fB\-s\fR, \fB\-\-symbolic\-link\fR
97 make symbolic links instead of copying
99 \fB\-S\fR, \fB\-\-suffix\fR=\fI\,SUFFIX\/\fR
100 override the usual backup suffix
102 \fB\-t\fR, \fB\-\-target\-directory\fR=\fI\,DIRECTORY\/\fR
103 copy all SOURCE arguments into DIRECTORY
105 \fB\-T\fR, \fB\-\-no\-target\-directory\fR
106 treat DEST as a normal file
108 \fB\-u\fR, \fB\-\-update\fR
109 copy only when the SOURCE file is newer
110 than the destination file or when the
111 destination file is missing
113 \fB\-v\fR, \fB\-\-verbose\fR
114 explain what is being done
116 \fB\-x\fR, \fB\-\-one\-file\-system\fR
117 stay on this file system
120 set SELinux security context of destination
123 \fB\-\-context\fR[=\fI\,CTX\/\fR]
124 like \fB\-Z\fR, or if CTX is specified then set the
125 SELinux or SMACK security context to CTX
128 display this help and exit
131 output version information and exit
133 By default, sparse SOURCE files are detected by a crude heuristic and the
134 corresponding DEST file is made sparse as well. That is the behavior
135 selected by \fB\-\-sparse\fR=\fI\,auto\/\fR. Specify \fB\-\-sparse\fR=\fI\,always\/\fR to create a sparse DEST
136 file whenever the SOURCE file contains a long enough sequence of zero bytes.
137 Use \fB\-\-sparse\fR=\fI\,never\/\fR to inhibit creation of sparse files.
139 When \fB\-\-reflink\fR[=\fI\,always\/\fR] is specified, perform a lightweight copy, where the
140 data blocks are copied only when modified. If this is not possible the copy
141 fails, or if \fB\-\-reflink\fR=\fI\,auto\/\fR is specified, fall back to a standard copy.
143 The backup suffix is '~', unless set with \fB\-\-suffix\fR or SIMPLE_BACKUP_SUFFIX.
144 The version control method may be selected via the \fB\-\-backup\fR option or through
145 the VERSION_CONTROL environment variable. Here are the values:
148 never make backups (even if \fB\-\-backup\fR is given)
151 make numbered backups
154 numbered if numbered backups exist, simple otherwise
157 always make simple backups
159 As a special case, cp makes a backup of SOURCE when the force and backup
160 options are given and SOURCE and DEST are the same name for an existing,
163 Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering.
165 GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
167 Report cp translation bugs to <http://translationproject.org/team/>
169 Copyright \(co 2016 Free Software Foundation, Inc.
170 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
172 This is free software: you are free to change and redistribute it.
173 There is NO WARRANTY, to the extent permitted by law.
175 Full documentation at: <http://www.gnu.org/software/coreutils/cp>
177 or available locally via: info \(aq(coreutils) cp invocation\(aq