tar.1 41 KB

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