tar.1 41 KB

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