| 1 |
.\" This file is part of GNU tar. -*- nroff -*- |
| 2 |
.\" Copyright 2013-2023 Free Software Foundation, Inc. |
| 3 |
.\" |
| 4 |
.\" GNU tar is free software; you can redistribute it and/or modify |
| 5 |
.\" it under the terms of the GNU General Public License as published by |
| 6 |
.\" the Free Software Foundation; either version 3 of the License, or |
| 7 |
.\" (at your option) any later version. |
| 8 |
.\" |
| 9 |
.\" GNU tar is distributed in the hope that it will be useful, |
| 10 |
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
.\" GNU General Public License for more details. |
| 13 |
.\" |
| 14 |
.\" You should have received a copy of the GNU General Public License |
| 15 |
.\" along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 |
.TH TAR 1 "July 11, 2022" "TAR" "GNU TAR Manual" |
| 17 |
.SH NAME |
| 18 |
tar \- an archiving utility |
| 19 |
.SH SYNOPSIS |
| 20 |
.SS Traditional usage |
| 21 |
\fBtar\fR {\fBA\fR|\fBc\fR|\fBd\fR|\fBr\fR|\fBt\fR|\fBu\fR|\fBx\fR}\ |
| 22 |
[\fBGnSkUWOmpsMBiajJzZhPlRvwo\fR] [\fIARG\fR...] |
| 23 |
.SS UNIX-style usage |
| 24 |
.sp |
| 25 |
\fBtar\fR \fB\-A\fR [\fIOPTIONS\fR] \fB\-f\fR \fIARCHIVE\fR \fIARCHIVE\fR... |
| 26 |
.sp |
| 27 |
\fBtar\fR \fB\-c\fR [\fB\-f\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fIFILE\fR...] |
| 28 |
.sp |
| 29 |
\fBtar\fR \fB\-d\fR [\fB\-f\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fIFILE\fR...] |
| 30 |
.sp |
| 31 |
\fBtar\fR \fB\-r\fR [\fB\-f\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fIFILE\fR...] |
| 32 |
.sp |
| 33 |
\fBtar\fR \fB\-t\fR [\fB\-f\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fIMEMBER\fR...] |
| 34 |
.sp |
| 35 |
\fBtar\fR \fB\-u\fR [\fB\-f\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fIFILE\fR...] |
| 36 |
.sp |
| 37 |
\fBtar\fR \fB\-x\fR [\fB\-f\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fIMEMBER\fR...] |
| 38 |
.SS GNU-style usage |
| 39 |
.sp |
| 40 |
\fBtar\fR {\fB\-\-catenate\fR|\fB\-\-concatenate\fR} [\fIOPTIONS\fR] \fB\-\-file\fR \fIARCHIVE\fR \fIARCHIVE\fR... |
| 41 |
.sp |
| 42 |
\fBtar\fR \fB\-\-create\fR [\fB\-\-file\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fIFILE\fR...] |
| 43 |
.sp |
| 44 |
\fBtar\fR {\fB\-\-diff\fR|\fB\-\-compare\fR} [\fB\-\-file\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fIFILE\fR...] |
| 45 |
.sp |
| 46 |
\fBtar\fR \fB\-\-delete\fR [\fB\-\-file\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fIMEMBER\fR...] |
| 47 |
.sp |
| 48 |
\fBtar\fR \fB\-\-append\fR [\fB\-\-file\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fIFILE\fR...] |
| 49 |
.sp |
| 50 |
\fBtar\fR \fB\-\-list\fR [\fB\-\-file\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fIMEMBER\fR...] |
| 51 |
.sp |
| 52 |
\fBtar\fR \fB\-\-test\-label\fR [\fB\-\-file\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fILABEL\fR...] |
| 53 |
.sp |
| 54 |
\fBtar\fR \fB\-\-update\fR [\fB\-\-file\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fIFILE\fR...] |
| 55 |
.sp |
| 56 |
\fBtar\fR {\fB\-\-extract\fR|\fB\-\-get\fR} [\fB\-\-file\fR \fIARCHIVE\fR] [\fIOPTIONS\fR] [\fIMEMBER\fR...] |
| 57 |
.SH NOTE |
| 58 |
This manpage is a short description of GNU \fBtar\fR. For a detailed |
| 59 |
discussion, including examples and usage recommendations, refer to the |
| 60 |
\fBGNU Tar Manual\fR available in texinfo format. If the \fBinfo\fR |
| 61 |
reader and the tar documentation are properly installed on your |
| 62 |
system, the command |
| 63 |
.PP |
| 64 |
.RS +4 |
| 65 |
.B info tar |
| 66 |
.RE |
| 67 |
.PP |
| 68 |
should give you access to the complete manual. |
| 69 |
.PP |
| 70 |
You can also view the manual using the info mode in |
| 71 |
.BR emacs (1), |
| 72 |
or find it in various formats online at |
| 73 |
.PP |
| 74 |
.RS +4 |
| 75 |
.B https://www.gnu.org/software/tar/manual |
| 76 |
.RE |
| 77 |
.PP |
| 78 |
If any discrepancies occur between this manpage and the |
| 79 |
\fBGNU Tar Manual\fR, the later shall be considered the authoritative |
| 80 |
source. |
| 81 |
.SH DESCRIPTION |
| 82 |
GNU |
| 83 |
.B tar |
| 84 |
is an archiving program designed to store multiple files in a single |
| 85 |
file (an \fBarchive\fR), and to manipulate such archives. The archive |
| 86 |
can be either a regular file or a device (e.g. a tape drive, hence the name |
| 87 |
of the program, which stands for \fBt\fRape \fBar\fRchiver), which can |
| 88 |
be located either on the local or on a remote machine. |
| 89 |
.PP |
| 90 |
|
| 91 |
.SS Option styles |
| 92 |
Options to GNU \fBtar\fR can be given in three different styles. |
| 93 |
In |
| 94 |
.BR "traditional style" , |
| 95 |
the first argument is a cluster of option letters and all subsequent |
| 96 |
arguments supply arguments to those options that require them. The |
| 97 |
arguments are read in the same order as the option letters. Any |
| 98 |
command line words that remain after all options have been processed |
| 99 |
are treated as non-option arguments: file or archive member names. |
| 100 |
.PP |
| 101 |
For example, the \fBc\fR option requires creating the archive, the |
| 102 |
\fBv\fR option requests the verbose operation, and the \fBf\fR option |
| 103 |
takes an argument that sets the name of the archive to operate upon. |
| 104 |
The following command, written in the traditional style, instructs tar |
| 105 |
to store all files from the directory |
| 106 |
.B /etc |
| 107 |
into the archive file |
| 108 |
.BR etc.tar , |
| 109 |
verbosely listing the files being archived: |
| 110 |
.PP |
| 111 |
.EX |
| 112 |
tar cfv etc.tar /etc |
| 113 |
.EE |
| 114 |
.PP |
| 115 |
In |
| 116 |
.BR "UNIX " or " short-option style" , |
| 117 |
each option letter is prefixed with a single dash, as in other command |
| 118 |
line utilities. If an option takes an argument, the argument follows it, |
| 119 |
either as a separate command line word, or immediately following the |
| 120 |
option. However, if the option takes an \fBoptional\fR argument, the |
| 121 |
argument must follow the option letter without any intervening |
| 122 |
whitespace, as in \fB\-g/tmp/snar.db\fR. |
| 123 |
.PP |
| 124 |
Any number of options not taking arguments can be |
| 125 |
clustered together after a single dash, e.g. \fB\-vkp\fR. An option |
| 126 |
that takes an argument (whether mandatory or optional) can appear at |
| 127 |
the end of such a cluster, e.g. \fB\-vkpf a.tar\fR. |
| 128 |
.PP |
| 129 |
The example command above written in the |
| 130 |
.B short-option style |
| 131 |
could look like: |
| 132 |
.PP |
| 133 |
.EX |
| 134 |
tar -cvf etc.tar /etc |
| 135 |
.EE |
| 136 |
or |
| 137 |
.EX |
| 138 |
tar -c -v -f etc.tar /etc |
| 139 |
.EE |
| 140 |
.PP |
| 141 |
In |
| 142 |
.BR "GNU " or " long-option style" , |
| 143 |
each option begins with two dashes and has a meaningful name, |
| 144 |
consisting of lower-case letters and dashes. When used, the long |
| 145 |
option can be abbreviated to its initial letters, provided that |
| 146 |
this does not create ambiguity. Arguments to long options are |
| 147 |
supplied either as a separate command line word, immediately following |
| 148 |
the option, or separated from the option by an equals sign with no |
| 149 |
intervening whitespace. Optional arguments must always use the latter |
| 150 |
method. |
| 151 |
.PP |
| 152 |
Here are several ways of writing the example command in this style: |
| 153 |
.PP |
| 154 |
.EX |
| 155 |
tar --create --file etc.tar --verbose /etc |
| 156 |
.EE |
| 157 |
or (abbreviating some options): |
| 158 |
.EX |
| 159 |
tar --cre --file=etc.tar --verb /etc |
| 160 |
.EE |
| 161 |
.PP |
| 162 |
The options in all three styles can be intermixed, although doing so |
| 163 |
with old options is not encouraged. |
| 164 |
.SS Operation mode |
| 165 |
The options listed in the table below tell GNU \fBtar\fR what |
| 166 |
operation it is to perform. Exactly one of them must be given. |
| 167 |
The meaning of non-option arguments depends on the operation mode |
| 168 |
requested. |
| 169 |
.TP |
| 170 |
\fB\-A\fR, \fB\-\-catenate\fR, \fB\-\-concatenate\fR |
| 171 |
Append archives to the end of another archive. The arguments are |
| 172 |
treated as the names of archives to append. All archives must be of |
| 173 |
the same format as the archive they are appended to, otherwise the |
| 174 |
resulting archive might be unusable with non-GNU implementations of |
| 175 |
\fBtar\fR. Notice also that when more than one archive is given, the |
| 176 |
members from archives other than the first one will be accessible in |
| 177 |
the resulting archive only when using the \fB\-i\fR |
| 178 |
(\fB\-\-ignore\-zeros\fR) option. |
| 179 |
|
| 180 |
Compressed archives cannot be concatenated. |
| 181 |
.TP |
| 182 |
\fB\-c\fR, \fB\-\-create\fR |
| 183 |
Create a new archive. Arguments supply the names of the files to be |
| 184 |
archived. Directories are archived recursively, unless the |
| 185 |
\fB\-\-no\-recursion\fR option is given. |
| 186 |
.TP |
| 187 |
\fB\-d\fR, \fB\-\-diff\fR, \fB\-\-compare\fR |
| 188 |
Find differences between archive and file system. The arguments are |
| 189 |
optional and specify archive members to compare. If not given, the |
| 190 |
current working directory is assumed. |
| 191 |
.TP |
| 192 |
\fB\-\-delete\fR |
| 193 |
Delete from the archive. The arguments supply names of the archive |
| 194 |
members to be removed. At least one argument must be given. |
| 195 |
|
| 196 |
This option does not operate on compressed archives. There is no |
| 197 |
short option equivalent. |
| 198 |
.TP |
| 199 |
\fB\-r\fR, \fB\-\-append\fR |
| 200 |
Append files to the end of an archive. Arguments have the same |
| 201 |
meaning as for \fB\-c\fR (\fB\-\-create\fR). |
| 202 |
.TP |
| 203 |
\fB\-t\fR, \fB\-\-list\fR |
| 204 |
List the contents of an archive. Arguments are optional. When given, |
| 205 |
they specify the names of the members to list. |
| 206 |
.TP |
| 207 |
\fB\-\-test\-label |
| 208 |
Test the archive volume label and exit. When used without arguments, |
| 209 |
it prints the volume label (if any) and exits with status \fB0\fR. |
| 210 |
When one or more command line arguments are given. |
| 211 |
.B tar |
| 212 |
compares the volume label with each argument. It exits with code |
| 213 |
\fB0\fR if a match is found, and with code \fB1\fR otherwise. No |
| 214 |
output is displayed, unless used together with the \fB\-v\fR |
| 215 |
(\fB\-\-verbose\fR) option. |
| 216 |
|
| 217 |
There is no short option equivalent for this option. |
| 218 |
.TP |
| 219 |
\fB\-u\fR, \fB\-\-update\fR |
| 220 |
Append files which are newer than the corresponding copy in the |
| 221 |
archive. Arguments have the same meaning as with the \fB\-c\fR and |
| 222 |
\fB\-r\fR options. Notice, that newer files don't replace their |
| 223 |
old archive copies, but instead are appended to the end of archive. |
| 224 |
The resulting archive can thus contain several members of the |
| 225 |
same name, corresponding to various versions of the same file. |
| 226 |
.TP |
| 227 |
\fB\-x\fR, \fB\-\-extract\fR, \fB\-\-get\fR |
| 228 |
Extract files from an archive. Arguments are optional. When given, |
| 229 |
they specify names of the archive members to be extracted. |
| 230 |
.TP |
| 231 |
.TP |
| 232 |
\fB\-\-show\-defaults\fR |
| 233 |
Show built-in defaults for various \fBtar\fR options and exit. |
| 234 |
.TP |
| 235 |
\fB\-?\fR, \fB\-\-help |
| 236 |
Display a short option summary and exit. |
| 237 |
.TP |
| 238 |
\fB\-\-usage\fR |
| 239 |
Display a list of available options and exit. |
| 240 |
.TP |
| 241 |
\fB\-\-version\fR |
| 242 |
Print program version and copyright information and exit. |
| 243 |
.SH OPTIONS |
| 244 |
.SS Operation modifiers |
| 245 |
.TP |
| 246 |
\fB\-\-check\-device\fR |
| 247 |
Check device numbers when creating incremental archives (default). |
| 248 |
.TP |
| 249 |
\fB\-g\fR, \fB\-\-listed\-incremental\fR=\fIFILE\fR |
| 250 |
Handle new GNU-format incremental backups. \fIFILE\fR is the name of |
| 251 |
a \fBsnapshot file\fR, where \fBtar\fR stores additional information which |
| 252 |
is used to decide which files changed since the previous incremental |
| 253 |
dump and, consequently, must be dumped again. If \fIFILE\fR does not |
| 254 |
exist when creating an archive, it will be created and all files will |
| 255 |
be added to the resulting archive (the \fBlevel 0\fR dump). To create |
| 256 |
incremental archives of non-zero level \fBN\fR, you need a copy of the |
| 257 |
snapshot file created for level \fBN-1\fR, and use it as \fIFILE\fR. |
| 258 |
|
| 259 |
When listing or extracting, the actual content of \fIFILE\fR is not |
| 260 |
inspected, it is needed only due to syntactical requirements. It is |
| 261 |
therefore common practice to use \fB/dev/null\fR in its place. |
| 262 |
.TP |
| 263 |
\fB\-\-hole\-detection\fR=\fIMETHOD\fR |
| 264 |
Use \fIMETHOD\fR to detect holes in sparse files. This option implies |
| 265 |
\fB\-\-sparse\fR. Valid values for \fIMETHOD\fR are \fBseek\fR and |
| 266 |
\fBraw\fR. Default is \fBseek\fR with fallback to \fBraw\fR when not |
| 267 |
applicable. |
| 268 |
.TP |
| 269 |
\fB\-G\fR, \fB\-\-incremental\fR |
| 270 |
Handle old GNU-format incremental backups. |
| 271 |
.TP |
| 272 |
\fB\-\-ignore\-failed\-read\fR |
| 273 |
Do not exit with nonzero on unreadable files. |
| 274 |
.TP |
| 275 |
\fB\-\-level\fR=\fINUMBER\fR |
| 276 |
Set dump level for a created listed-incremental archive. Currently only |
| 277 |
\fB\-\-level=0\fR is meaningful: it instructs \fBtar\fR to truncate |
| 278 |
the snapshot file before dumping, thereby forcing a level 0 dump. |
| 279 |
.TP |
| 280 |
\fB\-n\fR, \fB\-\-seek\fR |
| 281 |
Assume the archive is seekable. Normally \fBtar\fR determines |
| 282 |
automatically whether the archive can be seeked or not. This option |
| 283 |
is intended for use in cases when such recognition fails. It takes |
| 284 |
effect only if the archive is open for reading (e.g. with |
| 285 |
.B \-\-list |
| 286 |
or |
| 287 |
.B \-\-extract |
| 288 |
options). |
| 289 |
.TP |
| 290 |
\fB\-\-no\-check\-device\fR |
| 291 |
Do not check device numbers when creating incremental archives. |
| 292 |
.TP |
| 293 |
\fB\-\-no\-seek\fR |
| 294 |
Assume the archive is not seekable. |
| 295 |
.TP |
| 296 |
\fB\-\-occurrence\fR[=\fIN\fR] |
| 297 |
Process only the \fIN\fRth occurrence of each file in the |
| 298 |
archive. This option is valid only when used with one of the |
| 299 |
following subcommands: \fB\-\-delete\fR, \fB\-\-diff\fR, |
| 300 |
\fB\-\-extract\fR or \fB\-\-list\fR and when a list of files is given |
| 301 |
either on the command line or via the \fB\-T\fR option. The default |
| 302 |
\fIN\fR is \fB1\fR. |
| 303 |
.TP |
| 304 |
\fB\-\-restrict\fR |
| 305 |
Disable the use of some potentially harmful options. |
| 306 |
.TP |
| 307 |
\fB\-\-sparse\-version\fR=\fIMAJOR\fR[.\fIMINOR\fR] |
| 308 |
Set which version of the sparse format to use. |
| 309 |
This option implies |
| 310 |
.BR \-\-sparse . |
| 311 |
Valid argument values are |
| 312 |
.BR 0.0 , |
| 313 |
.BR 0.1 ", and" |
| 314 |
.BR 1.0 . |
| 315 |
For a detailed discussion of sparse formats, refer to the \fBGNU Tar |
| 316 |
Manual\fR, appendix \fBD\fR, "\fBSparse Formats\fR". Using the \fBinfo\fR |
| 317 |
reader, it can be accessed running the following command: |
| 318 |
.BR "info tar 'Sparse Formats'" . |
| 319 |
.TP |
| 320 |
\fB\-S\fR, \fB\-\-sparse\fR |
| 321 |
Handle sparse files efficiently. Some files in the file system may |
| 322 |
have segments which were actually never written (quite often these are |
| 323 |
database files created by such systems as \fBDBM\fR). When given this |
| 324 |
option, \fBtar\fR attempts to determine if the file is sparse prior to |
| 325 |
archiving it, and if so, to reduce the resulting archive size by not |
| 326 |
dumping empty parts of the file. |
| 327 |
.SS Overwrite control |
| 328 |
These options control \fBtar\fR actions when extracting a file over |
| 329 |
an existing copy on disk. |
| 330 |
.TP |
| 331 |
\fB\-k\fR, \fB\-\-keep\-old\-files\fR |
| 332 |
Don't replace existing files when extracting. |
| 333 |
.TP |
| 334 |
\fB\-\-keep\-newer\-files\fR |
| 335 |
Don't replace existing files that are newer than their archive copies. |
| 336 |
.TP |
| 337 |
\fB\-\-keep\-directory\-symlink\fR |
| 338 |
Don't replace existing symlinks to directories when extracting. |
| 339 |
.TP |
| 340 |
\fB\-\-no\-overwrite\-dir\fR |
| 341 |
Preserve metadata of existing directories. |
| 342 |
.TP |
| 343 |
\fB\-\-one\-top\-level\fR[\fB=\fIDIR\fR] |
| 344 |
Extract all files into \fIDIR\fR, or, if used without argument, into a |
| 345 |
subdirectory named by the base name of the archive (minus standard |
| 346 |
compression suffixes recognizable by \fB\-\-auto\-compress). |
| 347 |
.TP |
| 348 |
\fB\-\-overwrite\fR |
| 349 |
Overwrite existing files when extracting. |
| 350 |
.TP |
| 351 |
\fB\-\-overwrite\-dir\fR |
| 352 |
Overwrite metadata of existing directories when extracting (default). |
| 353 |
.TP |
| 354 |
\fB\-\-recursive\-unlink\fR |
| 355 |
Recursively remove all files in the directory prior to extracting it. |
| 356 |
.TP |
| 357 |
\fB\-\-remove\-files\fR |
| 358 |
Remove files from disk after adding them to the archive. |
| 359 |
.TP |
| 360 |
\fB\-\-skip\-old\-files |
| 361 |
Don't replace existing files when extracting, silently skip over them. |
| 362 |
.TP |
| 363 |
\fB\-U\fR, \fB\-\-unlink\-first\fR |
| 364 |
Remove each file prior to extracting over it. |
| 365 |
.TP |
| 366 |
\fB\-W\fR, \fB\-\-verify\fR |
| 367 |
Verify the archive after writing it. |
| 368 |
.SS Output stream selection |
| 369 |
.TP |
| 370 |
\fB\-\-ignore\-command\-error\fR |
| 371 |
Ignore subprocess exit codes. |
| 372 |
.TP |
| 373 |
\fB\-\-no\-ignore\-command\-error\fR |
| 374 |
Treat non-zero exit codes of children as error (default). |
| 375 |
.TP |
| 376 |
\fB\-O\fR, \fB\-\-to\-stdout\fR |
| 377 |
Extract files to standard output. |
| 378 |
.TP |
| 379 |
\fB\-\-to\-command\fR=\fICOMMAND\fR |
| 380 |
Pipe extracted files to \fICOMMAND\fR. The argument is the pathname |
| 381 |
of an external program, optionally with command line arguments. The |
| 382 |
program will be invoked and the contents of the file being extracted |
| 383 |
supplied to it on its standard input. Additional data will be |
| 384 |
supplied via the following environment variables: |
| 385 |
.RS |
| 386 |
.TP |
| 387 |
.B TAR_FILETYPE |
| 388 |
Type of the file. It is a single letter with the following meaning: |
| 389 |
.sp |
| 390 |
.nf |
| 391 |
.ta 8n 20n |
| 392 |
f Regular file |
| 393 |
d Directory |
| 394 |
l Symbolic link |
| 395 |
h Hard link |
| 396 |
b Block device |
| 397 |
c Character device |
| 398 |
.fi |
| 399 |
|
| 400 |
Currently only regular files are supported. |
| 401 |
.TP |
| 402 |
.B TAR_MODE |
| 403 |
File mode, an octal number. |
| 404 |
.TP |
| 405 |
.B TAR_FILENAME |
| 406 |
The name of the file. |
| 407 |
.TP |
| 408 |
.B TAR_REALNAME |
| 409 |
Name of the file as stored in the archive. |
| 410 |
.TP |
| 411 |
.B TAR_UNAME |
| 412 |
Name of the file owner. |
| 413 |
.TP |
| 414 |
.B TAR_GNAME |
| 415 |
Name of the file owner group. |
| 416 |
.TP |
| 417 |
.B TAR_ATIME |
| 418 |
Time of last access. It is a decimal number, representing seconds |
| 419 |
since the Epoch. If the archive provides times with nanosecond |
| 420 |
precision, the nanoseconds are appended to the timestamp after a |
| 421 |
decimal point. |
| 422 |
.TP |
| 423 |
.B TAR_MTIME |
| 424 |
Time of last modification. |
| 425 |
.TP |
| 426 |
.B TAR_CTIME |
| 427 |
Time of last status change. |
| 428 |
.TP |
| 429 |
.B TAR_SIZE |
| 430 |
Size of the file. |
| 431 |
.TP |
| 432 |
.B TAR_UID |
| 433 |
UID of the file owner. |
| 434 |
.TP |
| 435 |
.B TAR_GID |
| 436 |
GID of the file owner. |
| 437 |
.RE |
| 438 |
.RS |
| 439 |
|
| 440 |
Additionally, the following variables contain information about |
| 441 |
\fBtar\fR operation mode and the archive being processed: |
| 442 |
.TP |
| 443 |
.B TAR_VERSION |
| 444 |
GNU \fBtar\fR version number. |
| 445 |
.TP |
| 446 |
.B TAR_ARCHIVE |
| 447 |
The name of the archive \fBtar\fR is processing. |
| 448 |
.TP |
| 449 |
.B TAR_BLOCKING_FACTOR |
| 450 |
Current blocking factor, i.e. number of 512-byte blocks in a record. |
| 451 |
.TP |
| 452 |
.B TAR_VOLUME |
| 453 |
Ordinal number of the volume \fBtar\fR is processing (set if |
| 454 |
reading a multi-volume archive). |
| 455 |
.TP |
| 456 |
.B TAR_FORMAT |
| 457 |
Format of the archive being processed. One of: |
| 458 |
.BR gnu , |
| 459 |
.BR oldgnu , |
| 460 |
.BR posix , |
| 461 |
.BR ustar , |
| 462 |
.BR v7 . |
| 463 |
.TP |
| 464 |
.B TAR_SUBCOMMAND |
| 465 |
A short option (with a leading dash) describing the operation \fBtar\fR is |
| 466 |
executing. |
| 467 |
.RE |
| 468 |
.SS Handling of file attributes |
| 469 |
.TP |
| 470 |
\fB\-\-atime\-preserve\fR[=\fIMETHOD\fR] |
| 471 |
Preserve access times on dumped files, either by restoring the times |
| 472 |
after reading (\fIMETHOD\fR=\fBreplace\fR, this is the default) or by |
| 473 |
not setting the times in the first place (\fIMETHOD\fR=\fBsystem\fR). |
| 474 |
.TP |
| 475 |
\fB\-\-delay\-directory\-restore\fR |
| 476 |
Delay setting modification times and permissions of extracted |
| 477 |
directories until the end of extraction. Use this option when |
| 478 |
extracting from an archive which has unusual member ordering. |
| 479 |
.TP |
| 480 |
\fB\-\-group\fR=\fINAME\fR[:\fIGID\fR] |
| 481 |
Force \fINAME\fR as group for added files. If \fIGID\fR is not |
| 482 |
supplied, \fINAME\fR can be either a user name or numeric GID. In |
| 483 |
this case the missing part (GID or name) will be inferred from the |
| 484 |
current host's group database. |
| 485 |
|
| 486 |
When used with \fB\-\-group\-map\fR=\fIFILE\fR, affects only those |
| 487 |
files whose owner group is not listed in \fIFILE\fR. |
| 488 |
.TP |
| 489 |
\fB\-\-group\-map\fR=\fIFILE\fR |
| 490 |
Read group translation map from \fIFILE\fR. Empty lines are ignored. |
| 491 |
Comments are introduced with \fB#\fR sign and extend to the end of line. |
| 492 |
Each non-empty line in \fIFILE\fR defines translation for a single |
| 493 |
group. It must consist of two fields, delimited by any amount of whitespace: |
| 494 |
|
| 495 |
.EX |
| 496 |
\fIOLDGRP\fR \fINEWGRP\fR[\fB:\fINEWGID\fR] |
| 497 |
.EE |
| 498 |
|
| 499 |
\fIOLDGRP\fR is either a valid group name or a GID prefixed with |
| 500 |
\fB+\fR. Unless \fINEWGID\fR is supplied, \fINEWGRP\fR must also be |
| 501 |
either a valid group name or a \fB+\fIGID\fR. Otherwise, both |
| 502 |
\fINEWGRP\fR and \fINEWGID\fR need not be listed in the system group |
| 503 |
database. |
| 504 |
|
| 505 |
As a result, each input file with owner group \fIOLDGRP\fR will be |
| 506 |
stored in archive with owner group \fINEWGRP\fR and GID \fINEWGID\fR. |
| 507 |
.TP |
| 508 |
\fB\-\-mode\fR=\fICHANGES\fR |
| 509 |
Force symbolic mode \fICHANGES\fR for added files. |
| 510 |
.TP |
| 511 |
\fB\-\-mtime\fR=\fIDATE-OR-FILE\fR |
| 512 |
Set mtime for added files. \fIDATE-OR-FILE\fR is either a date/time |
| 513 |
in almost arbitrary format, or the name of an existing file. In the |
| 514 |
latter case the mtime of that file will be used. |
| 515 |
.TP |
| 516 |
\fB\-m\fR, \fB\-\-touch\fR |
| 517 |
Don't extract file modified time. |
| 518 |
.TP |
| 519 |
\fB\-\-no\-delay\-directory\-restore\fR |
| 520 |
Cancel the effect of the prior \fB\-\-delay\-directory\-restore\fR option. |
| 521 |
.TP |
| 522 |
\fB\-\-no\-same\-owner\fR |
| 523 |
Extract files as yourself (default for ordinary users). |
| 524 |
.TP |
| 525 |
\fB\-\-no\-same\-permissions\fR |
| 526 |
Apply the user's umask when extracting permissions from the archive |
| 527 |
(default for ordinary users). |
| 528 |
.TP |
| 529 |
\fB\-\-numeric\-owner\fR |
| 530 |
Always use numbers for user/group names. |
| 531 |
.TP |
| 532 |
\fB\-\-owner\fR=\fINAME\fR[:\fIUID\fR] |
| 533 |
Force \fINAME\fR as owner for added files. If \fIUID\fR is not |
| 534 |
supplied, \fINAME\fR can be either a user name or numeric UID. In |
| 535 |
this case the missing part (UID or name) will be inferred from the |
| 536 |
current host's user database. |
| 537 |
|
| 538 |
When used with \fB\-\-owner\-map\fR=\fIFILE\fR, affects only those |
| 539 |
files whose owner is not listed in \fIFILE\fR. |
| 540 |
.TP |
| 541 |
\fB\-\-owner\-map\fR=\fIFILE\fR |
| 542 |
Read owner translation map from \fIFILE\fR. Empty lines are ignored. |
| 543 |
Comments are introduced with \fB#\fR sign and extend to the end of line. |
| 544 |
Each non-empty line in \fIFILE\fR defines translation for a single |
| 545 |
UID. It must consist of two fields, delimited by any amount of whitespace: |
| 546 |
|
| 547 |
.EX |
| 548 |
\fIOLDUSR\fR \fINEWUSR\fR[\fB:\fINEWUID\fR] |
| 549 |
.EE |
| 550 |
|
| 551 |
\fIOLDUSR\fR is either a valid user name or a UID prefixed with |
| 552 |
\fB+\fR. Unless \fINEWUID\fR is supplied, \fINEWUSR\fR must also be |
| 553 |
either a valid user name or a \fB+\fIUID\fR. Otherwise, both |
| 554 |
\fINEWUSR\fR and \fINEWUID\fR need not be listed in the system user |
| 555 |
database. |
| 556 |
|
| 557 |
As a result, each input file owned by \fIOLDUSR\fR will be |
| 558 |
stored in archive with owner name \fINEWUSR\fR and UID \fINEWUID\fR. |
| 559 |
.TP |
| 560 |
\fB\-p\fR, \fB\-\-preserve\-permissions\fR, \fB\-\-same\-permissions\fR |
| 561 |
Set permissions of extracted files to those recorded in the archive |
| 562 |
(default for superuser). |
| 563 |
.TP |
| 564 |
\fB\-\-same\-owner\fR |
| 565 |
Try extracting files with the same ownership as exists in the archive |
| 566 |
(default for superuser). |
| 567 |
.TP |
| 568 |
\fB\-s\fR, \fB\-\-preserve\-order\fR, \fB\-\-same\-order\fR |
| 569 |
Tell \fBtar\fR that the list of file names to process is sorted in the |
| 570 |
same order as the files in the archive. |
| 571 |
.TP |
| 572 |
\fB\-\-sort=\fIORDER\fR |
| 573 |
When creating an archive, sort directory entries according to |
| 574 |
\fIORDER\fR, which is one of |
| 575 |
.BR none , |
| 576 |
.BR name ", or" |
| 577 |
.BR inode . |
| 578 |
|
| 579 |
The default is \fB\-\-sort=none\fR, which stores archive members in |
| 580 |
the same order as returned by the operating system. |
| 581 |
|
| 582 |
Using \fB\-\-sort=name\fR ensures the member ordering in the created archive |
| 583 |
is uniform and reproducible. |
| 584 |
|
| 585 |
Using \fB\-\-sort=inode\fR reduces the number of disk seeks made when |
| 586 |
creating the archive and thus can considerably speed up archivation. |
| 587 |
This sorting order is supported only if the underlying system provides |
| 588 |
the necessary information. |
| 589 |
.SS Extended file attributes |
| 590 |
.TP |
| 591 |
.B \-\-acls |
| 592 |
Enable POSIX ACLs support. |
| 593 |
.TP |
| 594 |
.B \-\-no\-acls |
| 595 |
Disable POSIX ACLs support. |
| 596 |
.TP |
| 597 |
.B \-\-selinux |
| 598 |
Enable SELinux context support. |
| 599 |
.TP |
| 600 |
.B \-\-no-selinux |
| 601 |
Disable SELinux context support. |
| 602 |
.TP |
| 603 |
.B \-\-xattrs |
| 604 |
Enable extended attributes support. |
| 605 |
.TP |
| 606 |
.B \-\-no\-xattrs |
| 607 |
Disable extended attributes support. |
| 608 |
.TP |
| 609 |
.BI \-\-xattrs\-exclude= PATTERN |
| 610 |
Specify the exclude pattern for xattr keys. \fIPATTERN\fR is a globbing |
| 611 |
pattern, e.g. \fB\-\-xattrs\-exclude='user.*'\fR to include only |
| 612 |
attributes from the user namespace. |
| 613 |
.TP |
| 614 |
.BI \-\-xattrs\-include= PATTERN |
| 615 |
Specify the include pattern for xattr keys. \fIPATTERN\fR is a globbing |
| 616 |
pattern. |
| 617 |
.SS Device selection and switching |
| 618 |
.TP |
| 619 |
\fB\-f\fR, \fB\-\-file\fR=\fIARCHIVE\fR |
| 620 |
Use archive file or device \fIARCHIVE\fR. If this option is not |
| 621 |
given, \fBtar\fR will first examine the environment variable `TAPE'. |
| 622 |
If it is set, its value will be used as the archive name. Otherwise, |
| 623 |
\fBtar\fR will assume the compiled-in default. The default |
| 624 |
value can be inspected either using the |
| 625 |
.B \-\-show\-defaults |
| 626 |
option, or at the end of the \fBtar \-\-help\fR output. |
| 627 |
|
| 628 |
An archive name that has a colon in it specifies a file or device on a |
| 629 |
remote machine. The part before the colon is taken as the machine |
| 630 |
name or IP address, and the part after it as the file or device |
| 631 |
pathname, e.g.: |
| 632 |
|
| 633 |
.EX |
| 634 |
--file=remotehost:/dev/sr0 |
| 635 |
.EE |
| 636 |
|
| 637 |
An optional username can be prefixed to the hostname, placing a \fB@\fR |
| 638 |
sign between them. |
| 639 |
|
| 640 |
By default, the remote host is accessed via the |
| 641 |
.BR rsh (1) |
| 642 |
command. Nowadays it is common to use |
| 643 |
.BR ssh (1) |
| 644 |
instead. You can do so by giving the following command line option: |
| 645 |
|
| 646 |
.EX |
| 647 |
--rsh-command=/usr/bin/ssh |
| 648 |
.EE |
| 649 |
|
| 650 |
The remote machine should have the |
| 651 |
.BR rmt (8) |
| 652 |
command installed. If its pathname does not match \fBtar\fR's |
| 653 |
default, you can inform \fBtar\fR about the correct pathname using the |
| 654 |
.B \-\-rmt\-command |
| 655 |
option. |
| 656 |
.TP |
| 657 |
\fB\-\-force\-local\fR |
| 658 |
Archive file is local even if it has a colon. |
| 659 |
.TP |
| 660 |
\fB\-F\fR, \fB\-\-info\-script\fR=\fICOMMAND\fR, \fB\-\-new\-volume\-script\fR=\fICOMMAND\fR |
| 661 |
Run \fICOMMAND\fR at the end of each tape (implies \fB\-M\fR). The |
| 662 |
command can include arguments. When started, it will inherit \fBtar\fR's |
| 663 |
environment plus the following variables: |
| 664 |
.RS |
| 665 |
.TP |
| 666 |
.B TAR_VERSION |
| 667 |
GNU \fBtar\fR version number. |
| 668 |
.TP |
| 669 |
.B TAR_ARCHIVE |
| 670 |
The name of the archive \fBtar\fR is processing. |
| 671 |
.TP |
| 672 |
.B TAR_BLOCKING_FACTOR |
| 673 |
Current blocking factor, i.e. number of 512-byte blocks in a record. |
| 674 |
.TP |
| 675 |
.B TAR_VOLUME |
| 676 |
Ordinal number of the volume \fBtar\fR is processing (set if |
| 677 |
reading a multi-volume archive). |
| 678 |
.TP |
| 679 |
.B TAR_FORMAT |
| 680 |
Format of the archive being processed. One of: |
| 681 |
.BR gnu , |
| 682 |
.BR oldgnu , |
| 683 |
.BR posix , |
| 684 |
.BR ustar , |
| 685 |
.BR v7 . |
| 686 |
.TP |
| 687 |
.B TAR_SUBCOMMAND |
| 688 |
A short option (with a leading dash) describing the operation \fBtar\fR is |
| 689 |
executing. |
| 690 |
.TP |
| 691 |
.B TAR_FD |
| 692 |
File descriptor which can be used to communicate the new volume name |
| 693 |
to |
| 694 |
.BR tar . |
| 695 |
.RE |
| 696 |
.RS |
| 697 |
|
| 698 |
If the info script fails, \fBtar\fR exits; otherwise, it begins writing |
| 699 |
the next volume. |
| 700 |
.RE |
| 701 |
.TP |
| 702 |
\fB\-L\fR, \fB\-\-tape\-length\fR=\fIN\fR |
| 703 |
Change tape after writing \fIN\fRx1024 bytes. If \fIN\fR is followed |
| 704 |
by a size suffix (see the subsection |
| 705 |
.B Size suffixes |
| 706 |
below), the suffix specifies the multiplicative factor to be used |
| 707 |
instead of 1024. |
| 708 |
|
| 709 |
This option implies |
| 710 |
.BR \-M . |
| 711 |
.TP |
| 712 |
\fB\-M\fR, \fB\-\-multi\-volume\fR |
| 713 |
Create/list/extract multi-volume archive. |
| 714 |
.TP |
| 715 |
\fB\-\-rmt\-command\fR=\fICOMMAND\fR |
| 716 |
Use \fICOMMAND\fR instead of \fBrmt\fR when accessing remote |
| 717 |
archives. See the description of the |
| 718 |
.B \-f |
| 719 |
option, above. |
| 720 |
.TP |
| 721 |
\fB\-\-rsh\-command\fR=\fICOMMAND\fR |
| 722 |
Use \fICOMMAND\fR instead of \fBrsh\fR when accessing remote |
| 723 |
archives. See the description of the |
| 724 |
.B \-f |
| 725 |
option, above. |
| 726 |
.TP |
| 727 |
\fB\-\-volno\-file\fR=\fIFILE\fR |
| 728 |
When this option is used in conjunction with |
| 729 |
.BR \-\-multi\-volume , |
| 730 |
.B tar |
| 731 |
will keep track of which volume of a multi-volume archive it is |
| 732 |
working in \fIFILE\fR. |
| 733 |
.SS Device blocking |
| 734 |
.TP |
| 735 |
\fB\-b\fR, \fB\-\-blocking\-factor\fR=\fIBLOCKS\fR |
| 736 |
Set record size to \fIBLOCKS\fRx\fB512\fR bytes. |
| 737 |
.TP |
| 738 |
\fB\-B\fR, \fB\-\-read\-full\-records\fR |
| 739 |
When listing or extracting, accept incomplete input records after |
| 740 |
end-of-file marker. |
| 741 |
.TP |
| 742 |
\fB\-i\fR, \fB\-\-ignore\-zeros\fR |
| 743 |
Ignore zeroed blocks in archive. Normally two consecutive 512-blocks |
| 744 |
filled with zeroes mean EOF and \fBtar\fR stops reading after encountering |
| 745 |
them. This option instructs it to read further and is useful when |
| 746 |
reading archives created with the \fB\-A\fR option. |
| 747 |
.TP |
| 748 |
\fB\-\-record\-size\fR=\fINUMBER\fR |
| 749 |
Set record size. \fINUMBER\fR is the number of bytes per record. It |
| 750 |
must be multiple of \fB512\fR. It can can be suffixed with a \fBsize |
| 751 |
suffix\fR, e.g. \fB\-\-record-size=10K\fR, for 10 Kilobytes. See the |
| 752 |
subsection |
| 753 |
.BR "Size suffixes" , |
| 754 |
for a list of valid suffixes. |
| 755 |
.SS Archive format selection |
| 756 |
.TP |
| 757 |
\fB\-H\fR, \fB\-\-format\fR=\fIFORMAT\fR |
| 758 |
Create archive of the given format. Valid formats are: |
| 759 |
.RS |
| 760 |
.TP |
| 761 |
.B gnu |
| 762 |
GNU tar 1.13.x format |
| 763 |
.TP |
| 764 |
.B oldgnu |
| 765 |
GNU format as per tar <= 1.12. |
| 766 |
.TP |
| 767 |
\fBpax\fR, \fBposix\fR |
| 768 |
POSIX 1003.1-2001 (pax) format. |
| 769 |
.TP |
| 770 |
.B ustar |
| 771 |
POSIX 1003.1-1988 (ustar) format. |
| 772 |
.TP |
| 773 |
.B v7 |
| 774 |
Old V7 tar format. |
| 775 |
.RE |
| 776 |
.TP |
| 777 |
\fB\-\-old\-archive\fR, \fB\-\-portability\fR |
| 778 |
Same as \fB\-\-format=v7\fR. |
| 779 |
.TP |
| 780 |
\fB\-\-pax\-option\fR=\fIkeyword\fR[[:]=\fIvalue\fR][,\fIkeyword\fR[[:]=\fIvalue\fR]]... |
| 781 |
Control pax keywords when creating \fBPAX\fR archives (\fB\-H |
| 782 |
pax\fR). This option is equivalent to the \fB\-o\fR option of the |
| 783 |
.BR pax (1) |
| 784 |
utility. |
| 785 |
.TP |
| 786 |
\fB\-\-posix\fR |
| 787 |
Same as \fB\-\-format=posix\fR. |
| 788 |
.TP |
| 789 |
\fB\-V\fR, \fB\-\-label\fR=\fITEXT\fR |
| 790 |
Create archive with volume name \fITEXT\fR. If listing or extracting, |
| 791 |
use \fITEXT\fR as a globbing pattern for volume name. |
| 792 |
.SS Compression options |
| 793 |
.TP |
| 794 |
\fB\-a\fR, \fB\-\-auto\-compress\fR |
| 795 |
Use archive suffix to determine the compression program. |
| 796 |
.TP |
| 797 |
\fB\-I\fR, \fB\-\-use\-compress\-program\fI=\fICOMMAND\fR |
| 798 |
Filter data through \fICOMMAND\fR. It must accept the \fB\-d\fR |
| 799 |
option, for decompression. The argument can contain command line |
| 800 |
options. |
| 801 |
.TP |
| 802 |
\fB\-j\fR, \fB\-\-bzip2\fR |
| 803 |
Filter the archive through |
| 804 |
.BR bzip2 (1). |
| 805 |
.TP |
| 806 |
\fB\-J\fR, \fB\-\-xz\fR |
| 807 |
Filter the archive through |
| 808 |
.BR xz (1). |
| 809 |
.TP |
| 810 |
\fB\-\-lzip\fR |
| 811 |
Filter the archive through |
| 812 |
.BR lzip (1). |
| 813 |
.TP |
| 814 |
\fB\-\-lzma\fR |
| 815 |
Filter the archive through |
| 816 |
.BR lzma (1). |
| 817 |
.TP |
| 818 |
\fB\-\-lzop\fR |
| 819 |
Filter the archive through |
| 820 |
.BR lzop (1). |
| 821 |
.TP |
| 822 |
\fB\-\-no\-auto\-compress\fR |
| 823 |
Do not use archive suffix to determine the compression program. |
| 824 |
.TP |
| 825 |
\fB\-z\fR, \fB\-\-gzip\fR, \fB\-\-gunzip\fR, \fB\-\-ungzip\fR |
| 826 |
Filter the archive through |
| 827 |
.BR gzip (1). |
| 828 |
.TP |
| 829 |
\fB\-Z\fR, \fB\-\-compress\fR, \fB\-\-uncompress\fR |
| 830 |
Filter the archive through |
| 831 |
.BR compress (1). |
| 832 |
.TP |
| 833 |
\fB\-\-zstd\fR |
| 834 |
Filter the archive through |
| 835 |
.BR zstd (1). |
| 836 |
.SS Local file selection |
| 837 |
.TP |
| 838 |
\fB\-\-add\-file\fR=\fIFILE\fR |
| 839 |
Add \fIFILE\fR to the archive (useful if its name starts with a dash). |
| 840 |
.TP |
| 841 |
\fB\-\-backup\fR[=\fICONTROL\fR] |
| 842 |
Backup before removal. The \fICONTROL\fR argument, if supplied, |
| 843 |
controls the backup policy. Its valid values are: |
| 844 |
.RS |
| 845 |
.TP |
| 846 |
.BR none ", " off |
| 847 |
Never make backups. |
| 848 |
.TP |
| 849 |
.BR t ", " numbered |
| 850 |
Make numbered backups. |
| 851 |
.TP |
| 852 |
.BR nil ", " existing |
| 853 |
Make numbered backups if numbered backups exist, simple backups otherwise. |
| 854 |
.TP |
| 855 |
.BR never ", " simple |
| 856 |
Always make simple backups |
| 857 |
.RS |
| 858 |
.RE |
| 859 |
|
| 860 |
If \fICONTROL\fR is not given, the value is taken from the |
| 861 |
.B VERSION_CONTROL |
| 862 |
environment variable. If it is not set, \fBexisting\fR is assumed. |
| 863 |
.RE |
| 864 |
.TP |
| 865 |
\fB\-C\fR, \fB\-\-directory\fR=\fIDIR\fR |
| 866 |
Change to \fIDIR\fR before performing any operations. This option is |
| 867 |
order-sensitive, i.e. it affects all options that follow. |
| 868 |
.TP |
| 869 |
\fB\-\-exclude\fR=\fIPATTERN\fR |
| 870 |
Exclude files matching \fIPATTERN\fR, a |
| 871 |
.BR glob (3)-style |
| 872 |
wildcard pattern. |
| 873 |
.TP |
| 874 |
\fB\-\-exclude\-backups\fR |
| 875 |
Exclude backup and lock files. |
| 876 |
.TP |
| 877 |
\fB\-\-exclude\-caches\fR |
| 878 |
Exclude contents of directories containing file \fBCACHEDIR.TAG\fR, |
| 879 |
except for the tag file itself. |
| 880 |
.TP |
| 881 |
\fB\-\-exclude\-caches\-all\fR |
| 882 |
Exclude directories containing file \fBCACHEDIR.TAG\fR and the file itself. |
| 883 |
.TP |
| 884 |
\fB\-\-exclude\-caches\-under\fR |
| 885 |
Exclude everything under directories containing \fBCACHEDIR.TAG\fR |
| 886 |
.TP |
| 887 |
\fB\-\-exclude\-ignore=\fIFILE\fR |
| 888 |
Before dumping a directory, see if it contains \fIFILE\fR. |
| 889 |
If so, read exclusion patterns from this file. The patterns affect |
| 890 |
only the directory itself. |
| 891 |
.TP |
| 892 |
\fB\-\-exclude\-ignore\-recursive=\fIFILE\fR |
| 893 |
Same as \fB\-\-exclude\-ignore\fR, except that patterns from |
| 894 |
\fIFILE\fR affect both the directory and all its subdirectories. |
| 895 |
.TP |
| 896 |
\fB\-\-exclude\-tag\fR=\fIFILE\fR |
| 897 |
Exclude contents of directories containing \fIFILE\fR, except for |
| 898 |
\fIFILE\fR itself. |
| 899 |
.TP |
| 900 |
\fB\-\-exclude\-tag\-all\fR=\fIFILE\fR |
| 901 |
Exclude directories containing \fIFILE\fR. |
| 902 |
.TP |
| 903 |
\fB\-\-exclude\-tag\-under\fR=\fIFILE\fR |
| 904 |
Exclude everything under directories containing \fIFILE\fR. |
| 905 |
.TP |
| 906 |
\fB\-\-exclude\-vcs\fR |
| 907 |
Exclude version control system directories. |
| 908 |
.TP |
| 909 |
\fB\-\-exclude\-vcs\-ignores\fR |
| 910 |
Exclude files that match patterns read from VCS-specific ignore |
| 911 |
files. Supported files are: |
| 912 |
.BR .cvsignore , |
| 913 |
.BR .gitignore , |
| 914 |
.BR .bzrignore ", and" |
| 915 |
.BR .hgignore . |
| 916 |
.TP |
| 917 |
\fB\-h\fR, \fB\-\-dereference\fR |
| 918 |
Follow symlinks; archive and dump the files they point to. |
| 919 |
.TP |
| 920 |
\fB\-\-hard\-dereference\fR |
| 921 |
Follow hard links; archive and dump the files they refer to. |
| 922 |
.TP |
| 923 |
\fB\-K\fR, \fB\-\-starting\-file\fR=\fIMEMBER\fR |
| 924 |
Begin at the given member in the archive. |
| 925 |
.TP |
| 926 |
\fB\-\-newer\-mtime\fR=\fIDATE\fR |
| 927 |
Work on files whose data changed after the \fIDATE\fR. If \fIDATE\fR |
| 928 |
starts with \fB/\fR or \fB.\fR it is taken to be a file name; the |
| 929 |
mtime of that file is used as the date. |
| 930 |
.TP |
| 931 |
\fB\-\-no\-null\fR |
| 932 |
Disable the effect of the previous \fB\-\-null\fR option. |
| 933 |
.TP |
| 934 |
\fB\-\-no\-recursion\fR |
| 935 |
Avoid descending automatically in directories. |
| 936 |
.TP |
| 937 |
\fB\-\-no\-unquote\fR |
| 938 |
Do not unquote input file or member names. |
| 939 |
.TP |
| 940 |
\fB\-\-no\-verbatim\-files\-from\fR |
| 941 |
Treat each line read from a file list as if it were supplied in the |
| 942 |
command line. I.e., leading and trailing whitespace is removed and, |
| 943 |
if the resulting string begins with a dash, it is treated as \fBtar\fR |
| 944 |
command line option. |
| 945 |
|
| 946 |
This is the default behavior. The \fB\-\-no\-verbatim\-files\-from\fR |
| 947 |
option is provided as a way to restore it after |
| 948 |
\fB\-\-verbatim\-files\-from\fR option. |
| 949 |
|
| 950 |
This option is positional: it affects all \fB\-\-files\-from\fR |
| 951 |
options that occur after it in, until \fB\-\-verbatim\-files\-from\fR |
| 952 |
option or end of line, whichever occurs first. |
| 953 |
|
| 954 |
It is implied by the \fB\-\-no\-null\fR option. |
| 955 |
.TP |
| 956 |
\fB\-\-null\fR |
| 957 |
Instruct subsequent \fB\-T\fR options to read null-terminated names |
| 958 |
verbatim (disables special handling of names that start with a dash). |
| 959 |
|
| 960 |
See also \fB\-\-verbatim\-files\-from\fR. |
| 961 |
.TP |
| 962 |
\fB\-N\fR, \fB\-\-newer\fR=\fIDATE\fR, \fB\-\-after\-date\fR=\fIDATE\fR |
| 963 |
Only store files newer than DATE. If \fIDATE\fR starts with \fB/\fR |
| 964 |
or \fB.\fR it is taken to be a file name; the mtime of that file is |
| 965 |
used as the date. |
| 966 |
.TP |
| 967 |
\fB\-\-one\-file\-system\fR |
| 968 |
Stay in local file system when creating archive. |
| 969 |
.TP |
| 970 |
\fB\-P\fR, \fB\-\-absolute\-names\fR |
| 971 |
Don't strip leading slashes from file names when creating archives. |
| 972 |
.TP |
| 973 |
\fB\-\-recursion\fR |
| 974 |
Recurse into directories (default). |
| 975 |
.TP |
| 976 |
\fB\-\-suffix\fR=\fISTRING\fR |
| 977 |
Backup before removal, override usual suffix. Default suffix is \fB~\fR, |
| 978 |
unless overridden by environment variable \fBSIMPLE_BACKUP_SUFFIX\fR. |
| 979 |
.TP |
| 980 |
\fB\-T\fR, \fB\-\-files\-from\fR=\fIFILE\fR |
| 981 |
Get names to extract or create from \fIFILE\fR. |
| 982 |
|
| 983 |
Unless specified otherwise, the \fIFILE\fR must contain a list of |
| 984 |
names separated by ASCII \fBLF\fR (i.e. one name per line). The |
| 985 |
names read are handled the same way as command line arguments. They |
| 986 |
undergo quote removal and word splitting, and any string that starts |
| 987 |
with a \fB\-\fR is handled as \fBtar\fR command line option. |
| 988 |
|
| 989 |
If this behavior is undesirable, it can be turned off using the |
| 990 |
\fB\-\-verbatim\-files\-from\fR option. |
| 991 |
|
| 992 |
The \fB\-\-null\fR option instructs \fBtar\fR that the names in |
| 993 |
\fIFILE\fR are separated by ASCII \fBNUL\fR character, instead of |
| 994 |
\fBLF\fR. It is useful if the list is generated by |
| 995 |
.BR find (1) |
| 996 |
.B \-print0 |
| 997 |
predicate. |
| 998 |
.TP |
| 999 |
\fB\-\-unquote\fR |
| 1000 |
Unquote file or member names (default). |
| 1001 |
.TP |
| 1002 |
\fB\-\-verbatim\-files\-from\fR |
| 1003 |
Treat each line obtained from a file list as a file name, even if it |
| 1004 |
starts with a dash. File lists are supplied with the |
| 1005 |
\fB\-\-files\-from\fR (\fB\-T\fR) option. The default behavior is to |
| 1006 |
handle names supplied in file lists as if they were typed in the |
| 1007 |
command line, i.e. any names starting with a dash are treated as |
| 1008 |
\fBtar\fR options. The \fB\-\-verbatim\-files\-from\fR option |
| 1009 |
disables this behavior. |
| 1010 |
|
| 1011 |
This option affects all \fB\-\-files\-from\fR options that occur after |
| 1012 |
it in the command line. Its effect is reverted by the |
| 1013 |
\fB\-\-no\-verbatim\-files\-from\fR option. |
| 1014 |
|
| 1015 |
This option is implied by the \fB\-\-null\fR option. |
| 1016 |
|
| 1017 |
See also \fB\-\-add\-file\fR. |
| 1018 |
.TP |
| 1019 |
\fB\-X\fR, \fB\-\-exclude\-from\fR=\fIFILE\fR |
| 1020 |
Exclude files matching patterns listed in FILE. |
| 1021 |
.SS File name transformations |
| 1022 |
.TP |
| 1023 |
\fB\-\-strip\-components\fR=\fINUMBER\fR |
| 1024 |
Strip \fINUMBER\fR leading components from file names on extraction. |
| 1025 |
.TP |
| 1026 |
\fB\-\-transform\fR=\fIEXPRESSION\fR, \fB\-\-xform\fR=\fIEXPRESSION\fR |
| 1027 |
Use sed replace \fIEXPRESSION\fR to transform file names. |
| 1028 |
.SS File name matching options |
| 1029 |
These options affect both exclude and include patterns. |
| 1030 |
.TP |
| 1031 |
\fB\-\-anchored\fR |
| 1032 |
Patterns match file name start. |
| 1033 |
.TP |
| 1034 |
\fB\-\-ignore\-case\fR |
| 1035 |
Ignore case. |
| 1036 |
.TP |
| 1037 |
\fB\-\-no\-anchored\fR |
| 1038 |
Patterns match after any \fB/\fR (default for exclusion). |
| 1039 |
.TP |
| 1040 |
\fB\-\-no\-ignore\-case\fR |
| 1041 |
Case sensitive matching (default). |
| 1042 |
.TP |
| 1043 |
\fB\-\-no\-wildcards\fR |
| 1044 |
Verbatim string matching. |
| 1045 |
.TP |
| 1046 |
\fB\-\-no\-wildcards\-match\-slash\fR |
| 1047 |
Wildcards do not match \fB/\fR. |
| 1048 |
.TP |
| 1049 |
\fB\-\-wildcards\fR |
| 1050 |
Use wildcards (default for exclusion). |
| 1051 |
.TP |
| 1052 |
\fB\-\-wildcards\-match\-slash\fR |
| 1053 |
Wildcards match \fB/\fR (default for exclusion). |
| 1054 |
.SS Informative output |
| 1055 |
.TP |
| 1056 |
\fB\-\-checkpoint\fR[=\fIN\fR] |
| 1057 |
Display progress messages every \fIN\fRth record (default 10). |
| 1058 |
.TP |
| 1059 |
\fB\-\-checkpoint\-action\fR=\fIACTION\fR |
| 1060 |
Run \fIACTION\fR on each checkpoint. |
| 1061 |
.TP |
| 1062 |
\fB\-\-clamp\-mtime\fR |
| 1063 |
Only set time when the file is more recent than what was given with |
| 1064 |
\fB\-\-mtime\fR. |
| 1065 |
.TP |
| 1066 |
\fB\-\-full\-time\fR |
| 1067 |
Print file time to its full resolution. |
| 1068 |
.TP |
| 1069 |
\fB\-\-index\-file\fR=\fIFILE\fR |
| 1070 |
Send verbose output to \fIFILE\fR. |
| 1071 |
.TP |
| 1072 |
\fB\-l\fR, \fB\-\-check\-links\fR |
| 1073 |
Print a message if not all links are dumped. |
| 1074 |
.TP |
| 1075 |
\fB\-\-no\-quote\-chars\fR=\fISTRING\fR |
| 1076 |
Disable quoting for characters from \fISTRING\fR. |
| 1077 |
.TP |
| 1078 |
\fB\-\-quote\-chars\fR=\fISTRING\fR |
| 1079 |
Additionally quote characters from \fISTRING\fR. |
| 1080 |
.TP |
| 1081 |
\fB\-\-quoting\-style\fR=\fISTYLE\fR |
| 1082 |
Set quoting style for file and member names. Valid values for |
| 1083 |
\fISTYLE\fR are |
| 1084 |
.BR literal , |
| 1085 |
.BR shell , |
| 1086 |
.BR shell-always , |
| 1087 |
.BR c , |
| 1088 |
.BR c-maybe , |
| 1089 |
.BR escape , |
| 1090 |
.BR locale , |
| 1091 |
.BR clocale . |
| 1092 |
.TP |
| 1093 |
\fB\-R\fR, \fB\-\-block\-number\fR |
| 1094 |
Show block number within archive with each message. |
| 1095 |
.TP |
| 1096 |
\fB\-\-show\-omitted\-dirs\fR |
| 1097 |
When listing or extracting, list each directory that does not match |
| 1098 |
search criteria. |
| 1099 |
.TP |
| 1100 |
\fB\-\-show\-transformed\-names\fR, \fB\-\-show\-stored\-names\fR |
| 1101 |
Show file or archive names after transformation by \fB\-\-strip\fR and |
| 1102 |
\fB\-\-transform\fR options. |
| 1103 |
.TP |
| 1104 |
\fB\-\-totals\fR[=\fISIGNAL\fR] |
| 1105 |
Print total bytes after processing the archive. If \fISIGNAL\fR is |
| 1106 |
given, print total bytes when this signal is delivered. Allowed |
| 1107 |
signals are: |
| 1108 |
.BR SIGHUP , |
| 1109 |
.BR SIGQUIT , |
| 1110 |
.BR SIGINT , |
| 1111 |
.BR SIGUSR1 ", and" |
| 1112 |
.BR SIGUSR2 . |
| 1113 |
The \fBSIG\fR prefix can be omitted. |
| 1114 |
.TP |
| 1115 |
\fB\-\-utc\fR |
| 1116 |
Print file modification times in UTC. |
| 1117 |
.TP |
| 1118 |
\fB\-v\fR, \fB\-\-verbose\fR |
| 1119 |
Verbosely list files processed. Each instance of this option on the |
| 1120 |
command line increases the verbosity level by one. The maximum |
| 1121 |
verbosity level is 3. For a detailed discussion of how various |
| 1122 |
verbosity levels affect tar's output, please refer to \fBGNU Tar |
| 1123 |
Manual\fR, subsection 2.5.2 "\fBThe '\-\-verbose' Option\fR". |
| 1124 |
.TP |
| 1125 |
\fB\-\-warning\fR=\fIKEYWORD\fR |
| 1126 |
Enable or disable warning messages identified by \fIKEYWORD\fR. The |
| 1127 |
messages are suppressed if \fIKEYWORD\fR is prefixed with \fBno\-\fR |
| 1128 |
and enabled otherwise. |
| 1129 |
|
| 1130 |
Multiple \fB\-\-warning\fR options accumulate. |
| 1131 |
|
| 1132 |
Keywords controlling general \fBtar\fR operation: |
| 1133 |
.RS |
| 1134 |
.TP |
| 1135 |
.B all |
| 1136 |
Enable all warning messages. This is the default. |
| 1137 |
.TP |
| 1138 |
.B none |
| 1139 |
Disable all warning messages. |
| 1140 |
.TP |
| 1141 |
.B filename-with-nuls |
| 1142 |
"%s: file name read contains nul character" |
| 1143 |
.TP |
| 1144 |
.B alone-zero-block |
| 1145 |
"A lone zero block at %s" |
| 1146 |
.HP |
| 1147 |
Keywords applicable for \fBtar --create\fR: |
| 1148 |
.TP |
| 1149 |
.B cachedir |
| 1150 |
"%s: contains a cache directory tag %s; %s" |
| 1151 |
.TP |
| 1152 |
.B file-shrank |
| 1153 |
"%s: File shrank by %s bytes; padding with zeros" |
| 1154 |
.TP |
| 1155 |
.B xdev |
| 1156 |
"%s: file is on a different filesystem; not dumped" |
| 1157 |
.TP |
| 1158 |
.B file-ignored |
| 1159 |
"%s: Unknown file type; file ignored" |
| 1160 |
.br |
| 1161 |
"%s: socket ignored" |
| 1162 |
.br |
| 1163 |
"%s: door ignored" |
| 1164 |
.TP |
| 1165 |
.B file-unchanged |
| 1166 |
"%s: file is unchanged; not dumped" |
| 1167 |
.TP |
| 1168 |
.B ignore-archive |
| 1169 |
"%s: archive cannot contain itself; not dumped" |
| 1170 |
.TP |
| 1171 |
.B file-removed |
| 1172 |
"%s: File removed before we read it" |
| 1173 |
.TP |
| 1174 |
.B file-changed |
| 1175 |
"%s: file changed as we read it" |
| 1176 |
.TP |
| 1177 |
.B failed-read |
| 1178 |
Suppresses warnings about unreadable files or directories. This |
| 1179 |
keyword applies only if used together with the |
| 1180 |
.B \-\-ignore\-failed\-read |
| 1181 |
option. |
| 1182 |
.HP |
| 1183 |
Keywords applicable for \fBtar --extract\fR: |
| 1184 |
.TP |
| 1185 |
.B existing\-file |
| 1186 |
"%s: skipping existing file" |
| 1187 |
.TP |
| 1188 |
.B timestamp |
| 1189 |
"%s: implausibly old time stamp %s" |
| 1190 |
.br |
| 1191 |
"%s: time stamp %s is %s s in the future" |
| 1192 |
.TP |
| 1193 |
.B contiguous-cast |
| 1194 |
"Extracting contiguous files as regular files" |
| 1195 |
.TP |
| 1196 |
.B symlink-cast |
| 1197 |
"Attempting extraction of symbolic links as hard links" |
| 1198 |
.TP |
| 1199 |
.B unknown-cast |
| 1200 |
"%s: Unknown file type '%c', extracted as normal file" |
| 1201 |
.TP |
| 1202 |
.B ignore-newer |
| 1203 |
"Current %s is newer or same age" |
| 1204 |
.TP |
| 1205 |
.B unknown-keyword |
| 1206 |
"Ignoring unknown extended header keyword '%s'" |
| 1207 |
.TP |
| 1208 |
.B decompress-program |
| 1209 |
Controls verbose description of failures occurring when trying to run |
| 1210 |
alternative decompressor programs. This warning is disabled by |
| 1211 |
default (unless \fB\-\-verbose\fR is used). A common example of what |
| 1212 |
you can get when using this warning is: |
| 1213 |
|
| 1214 |
.EX |
| 1215 |
$ tar --warning=decompress-program -x -f archive.Z |
| 1216 |
tar (child): cannot run compress: No such file or directory |
| 1217 |
tar (child): trying gzip |
| 1218 |
.EE |
| 1219 |
|
| 1220 |
This means that \fBtar\fR first tried to decompress |
| 1221 |
\fBarchive.Z\fR using \fBcompress\fR, and, when that |
| 1222 |
failed, switched to \fBgzip\fR. |
| 1223 |
.TP |
| 1224 |
.B record-size |
| 1225 |
"Record size = %lu blocks" |
| 1226 |
.HP |
| 1227 |
Keywords controlling incremental extraction: |
| 1228 |
.TP |
| 1229 |
.B rename-directory |
| 1230 |
"%s: Directory has been renamed from %s" |
| 1231 |
.br |
| 1232 |
"%s: Directory has been renamed" |
| 1233 |
.TP |
| 1234 |
.B new-directory |
| 1235 |
"%s: Directory is new" |
| 1236 |
.TP |
| 1237 |
.B xdev |
| 1238 |
"%s: directory is on a different device: not purging" |
| 1239 |
.TP |
| 1240 |
.B bad-dumpdir |
| 1241 |
"Malformed dumpdir: 'X' never used" |
| 1242 |
.RE |
| 1243 |
.TP |
| 1244 |
\fB\-w\fR, \fB\-\-interactive\fR, \fB\-\-confirmation\fR |
| 1245 |
Ask for confirmation for every action. |
| 1246 |
.SS Compatibility options |
| 1247 |
.TP |
| 1248 |
\fB\-o\fR |
| 1249 |
When creating, same as \fB\-\-old\-archive\fR. When extracting, same |
| 1250 |
as \fB\-\-no\-same\-owner\fR. |
| 1251 |
.SS Size suffixes |
| 1252 |
.sp |
| 1253 |
.nf |
| 1254 |
.ta 8n 18n 42n |
| 1255 |
.ul |
| 1256 |
Suffix Units Byte Equivalent |
| 1257 |
b Blocks \fISIZE\fR x 512 |
| 1258 |
B Kilobytes \fISIZE\fR x 1024 |
| 1259 |
c Bytes \fISIZE\fR |
| 1260 |
G Gigabytes \fISIZE\fR x 1024^3 |
| 1261 |
K Kilobytes \fISIZE\fR x 1024 |
| 1262 |
k Kilobytes \fISIZE\fR x 1024 |
| 1263 |
M Megabytes \fISIZE\fR x 1024^2 |
| 1264 |
P Petabytes \fISIZE\fR x 1024^5 |
| 1265 |
T Terabytes \fISIZE\fR x 1024^4 |
| 1266 |
w Words \fISIZE\fR x 2 |
| 1267 |
.fi |
| 1268 |
.PP |
| 1269 |
.SH "RETURN VALUE" |
| 1270 |
Tar's exit code indicates whether it was able to successfully perform |
| 1271 |
the requested operation, and if not, what kind of error occurred. |
| 1272 |
.TP |
| 1273 |
.B 0 |
| 1274 |
Successful termination. |
| 1275 |
.TP |
| 1276 |
.B 1 |
| 1277 |
.I Some files differ. |
| 1278 |
If \fBtar\fR was invoked with the \fB\-\-compare\fR (\fB\-\-diff\fR, \fB\-d\fR) |
| 1279 |
command line option, this means that some files in the archive differ |
| 1280 |
from their disk counterparts. If \fBtar\fR was given one of the \fB\-\-create\fR, |
| 1281 |
\fB\-\-append\fR or \fB\-\-update\fR options, this exit code means |
| 1282 |
that some files were changed while being archived and so the resulting |
| 1283 |
archive does not contain the exact copy of the file set. |
| 1284 |
.TP |
| 1285 |
.B 2 |
| 1286 |
.I Fatal error. |
| 1287 |
This means that some fatal, unrecoverable error occurred. |
| 1288 |
.PP |
| 1289 |
If a subprocess that had been invoked by |
| 1290 |
.B tar |
| 1291 |
exited with a nonzero exit code, |
| 1292 |
.B tar |
| 1293 |
itself exits with that code as well. This can happen, for example, if |
| 1294 |
a compression option (e.g. \fB\-z\fR) was used and the external |
| 1295 |
compressor program failed. Another example is |
| 1296 |
.B rmt |
| 1297 |
failure during backup to a remote device. |
| 1298 |
.SH "SEE ALSO" |
| 1299 |
.BR bzip2 (1), |
| 1300 |
.BR compress (1), |
| 1301 |
.BR gzip (1), |
| 1302 |
.BR lzma (1), |
| 1303 |
.BR lzop (1), |
| 1304 |
.BR rmt (8), |
| 1305 |
.BR symlink (7), |
| 1306 |
.BR xz (1), |
| 1307 |
.BR zstd (1). |
| 1308 |
.PP |
| 1309 |
Complete \fBtar\fR manual: run |
| 1310 |
.B info tar |
| 1311 |
or use |
| 1312 |
.BR emacs (1) |
| 1313 |
info mode to read it. |
| 1314 |
.PP |
| 1315 |
Online copies of \fBGNU tar\fR documentation in various formats can be |
| 1316 |
found at: |
| 1317 |
.PP |
| 1318 |
.in +4 |
| 1319 |
.B https://www.gnu.org/software/tar/manual |
| 1320 |
.SH "BUG REPORTS" |
| 1321 |
Report bugs to <bug\[email protected]>. |
| 1322 |
.SH COPYRIGHT |
| 1323 |
Copyright \(co 2023 Free Software Foundation, Inc. |
| 1324 |
.br |
| 1325 |
.na |
| 1326 |
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> |
| 1327 |
.br |
| 1328 |
.ad |
| 1329 |
This is free software: you are free to change and redistribute it. |
| 1330 |
There is NO WARRANTY, to the extent permitted by law. |
| 1331 |
.\" Local variables: |
| 1332 |
.\" eval: (add-hook 'write-file-hooks 'time-stamp) |
| 1333 |
.\" time-stamp-start: ".TH [A-Z_][A-Z0-9_.\\-]* [0-9] \"" |
| 1334 |
.\" time-stamp-format: "%:B %:d, %:y" |
| 1335 |
.\" time-stamp-end: "\"" |
| 1336 |
.\" time-stamp-line-limit: 20 |
| 1337 |
.\" end: |