1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.35.
2 .TH CP "1" "May 2014" "GNU coreutils 8.21" "User Commands"
4 cp \- copy files and directories
7 [\fIOPTION\fR]... [\fI-T\fR] \fISOURCE DEST\fR
10 [\fIOPTION\fR]... \fISOURCE\fR... \fIDIRECTORY\fR
13 [\fIOPTION\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=\fIall\fR
24 \fB\-\-attributes\-only\fR
25 don't copy the file data, just the attributes
27 \fB\-\-backup\fR[=\fICONTROL\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=\fIlinks\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=\fImode\fR,ownership,timestamps
67 \fB\-\-preserve\fR[=\fIATTR_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=\fIATTR_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[=\fIWHEN\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=\fIWHEN\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=\fISUFFIX\fR
100 override the usual backup suffix
102 \fB\-t\fR, \fB\-\-target\-directory\fR=\fIDIRECTORY\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 display this help and exit
123 output version information and exit
125 By default, sparse SOURCE files are detected by a crude heuristic and the
126 corresponding DEST file is made sparse as well. That is the behavior
127 selected by \fB\-\-sparse\fR=\fIauto\fR. Specify \fB\-\-sparse\fR=\fIalways\fR to create a sparse DEST
128 file whenever the SOURCE file contains a long enough sequence of zero bytes.
129 Use \fB\-\-sparse\fR=\fInever\fR to inhibit creation of sparse files.
131 When \fB\-\-reflink\fR[=\fIalways\fR] is specified, perform a lightweight copy, where the
132 data blocks are copied only when modified. If this is not possible the copy
133 fails, or if \fB\-\-reflink\fR=\fIauto\fR is specified, fall back to a standard copy.
135 The backup suffix is '~', unless set with \fB\-\-suffix\fR or SIMPLE_BACKUP_SUFFIX.
136 The version control method may be selected via the \fB\-\-backup\fR option or through
137 the VERSION_CONTROL environment variable. Here are the values:
140 never make backups (even if \fB\-\-backup\fR is given)
143 make numbered backups
146 numbered if numbered backups exist, simple otherwise
149 always make simple backups
151 As a special case, cp makes a backup of SOURCE when the force and backup
152 options are given and SOURCE and DEST are the same name for an existing,
155 Written by Torbjorn Granlund, David MacKenzie, and Jim Meyering.
157 Report cp bugs to bug\-coreutils@gnu.org
159 GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
161 General help using GNU software: <http://www.gnu.org/gethelp/>
163 Report cp translation bugs to <http://translationproject.org/team/>
165 Copyright \(co 2013 Free Software Foundation, Inc.
166 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
168 This is free software: you are free to change and redistribute it.
169 There is NO WARRANTY, to the extent permitted by law.
171 The full documentation for
173 is maintained as a Texinfo manual. If the
177 programs are properly installed at your site, the command
179 .B info coreutils \(aqcp invocation\(aq
181 should give you access to the complete manual.