1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
|
.TH TAR 1 "Oct 2004" "GNU" "tar"
.SH NAME
tar \- The GNU version of the tar archiving utility
.SH SYNOPSIS
.B tar
.I <operation> [options]
.I Operations:
.nf
.B [-]A --catenate --concatenate
.B [-]c --create
.B [-]d --diff --compare
.B [-]r --append
.B [-]t --list
.B [-]u --update
.B [-]x --extract --get
.B --delete
.fi
.I Common Options:
.nf
.B -C, --directory DIR
.B -f, --file F
.B -j, --bzip2
.B -p, --preserve-permissions
.B -v, --verbose
.B -z, --gzip
.fi
.I All Options:
.br
[
.B --atime-preserve
]
[
.B -b, --blocking-factor N
]
[
.B -B, --read-full-records
]
[
.B --backup BACKUP-TYPE
]
[
.B --block-compress
]
[
.B -C, --directory DIR
]
[
.B --check-links
]
[
.B --checkpoint
]
[
.B -f, --file [HOSTNAME:]F
]
[
.B -F, --info-script F --new-volume-script F
]
[
.B --force-local
]
[
.B --format FORMAT
]
[
.B -g, --listed-incremental F
]
[
.B -G, --incremental
]
[
.B --group GROUP
]
[
.B -h, --dereference
]
[
.B --help
]
[
.B -i, --ignore-zeros
]
[
.B --ignore-case
]
[
.B --ignore-failed-read
]
[
.B --index-file FILE
]
[
.B -j, --bzip2
]
[
.B -k, --keep-old-files
]
[
.B -K, --starting-file F
]
[
.B --keep-newer-files
]
[
.B -l, --one-file-system
]
[
.B -L, --tape-length N
]
[
.B -m, --touch, --modification-time
]
[
.B -M, --multi-volume
]
[
.B --mode PERMISSIONS
]
[
.B -N, --after-date DATE, --newer DATE
]
[
.B --newer-mtime DATE
]
[
.B --no-anchored
]
[
.B --no-ignore-case
]
[
.B --no-recursion
]
[
.B --no-same-permissions
]
[
.B --no-wildcards
]
[
.B --no-wildcards-match-slash
]
[
.B --null
]
[
.B --numeric-owner
]
[
.B -o, --old-archive, --portability, --no-same-owner
]
[
.B -O, --to-stdout
]
[
.B --occurrence NUM
]
[
.B --overwrite
]
[
.B --overwrite-dir
]
[
.B --owner USER
]
[
.B -p, --same-permissions, --preserve-permissions
]
[
.B -P, --absolute-names
]
[
.B --pax-option KEYWORD-LIST
]
[
.B --posix
]
[
.B --preserve
]
[
.B --acls
]
[
.B --selinux
]
[
.B --xattrs
]
[
.B --no-acls
]
[
.B --no-selinux
]
[
.B --no-xattrs
]
[
.B -R, --block-number
]
[
.B --record-size SIZE
]
[
.B --recursion
]
[
.B --recursive-unlink
]
[
.B --remove-files
]
[
.B --rmt-command CMD
]
[
.B --rsh-command CMD
]
[
.B -s, --same-order, --preserve-order
]
[
.B -S, --sparse
]
[
.B --same-owner
]
[
.B --show-defaults
]
[
.B --show-omitted-dirs
]
[
.B --strip-components NUMBER, --strip-path NUMBER (1)
]
[
.B --suffix SUFFIX
]
[
.B -T, --files-from F
]
[
.B --totals
]
[
.B -U, --unlink-first
]
[
.B --use-compress-program PROG
]
[
.B --utc
]
[
.B -v, --verbose
]
[
.B -V, --label NAME
]
[
.B --version
]
[
.B --volno-file F
]
[
.B -w, --interactive, --confirmation
]
[
.B -W, --verify
]
[
.B --wildcards
]
[
.B --wildcards-match-slash
]
[
.B --exclude PATTERN
]
[
.B -X, --exclude-from FILE
]
[
.B -Z, --compress, --uncompress
]
[
.B -z, --gzip, --gunzip, --ungzip
]
[
.B -[0-7][lmh]
]
(1) tar-1.14 uses --strip-path, tar-1.14.90+ uses --strip-components
.SH DESCRIPTION
This manual page documents the GNU version of \fBtar\fR, an archiving
program designed to store and extract files from an archive file known
as a \fItarfile\fR. A \fItarfile\fR may be made on a tape drive,
however, it is also common to write a \fItarfile\fR to a normal file.
The first argument to \fBtar\fR must be one of the options \fBAcdrtux\fR,
followed by any optional functions. The final arguments to \fBtar\fR
are the names of the files or directories which should be archived. The
use of a directory name always implies that the subdirectories below
should be included in the archive.
.SH EXAMPLES
.TP
.B tar -xvf foo.tar
verbosely extract foo.tar
.TP
.B tar -xzf foo.tar.gz
extract gzipped foo.tar.gz
.TP
.B tar -cjf foo.tar.bz2 bar/
create bzipped tar archive of the directory bar called foo.tar.bz2
.TP
.B tar -xjf foo.tar.bz2 -C bar/
extract bzipped foo.tar.bz2 after changing directory to bar
.TP
.B tar -xzf foo.tar.gz blah.txt
extract the file blah.txt from foo.tar.gz
.SH "FUNCTION LETTERS"
.TP
.B One of the following options must be used:
.TP
.B -A, --catenate, --concatenate
append tar files to an archive
.TP
.B -c, --create
create a new archive
.TP
.B -d, --diff, --compare
find differences between archive and file system
.TP
.B -r, --append
append files to the end of an archive
.TP
.B -t, --list
list the contents of an archive
.TP
.B -u, --update
only append files that are newer than the existing in archive
.TP
.B -x, --extract, --get
extract files from an archive
.TP
.B --delete
delete from the archive (not for use on mag tapes!)
.SH "COMMON OPTIONS"
.TP
.B -C, --directory DIR
change to directory DIR
.TP
.B -f, --file [HOSTNAME:]F
use archive file or device F (default "-", meaning stdin/stdout)
.TP
.B -j, --bzip2
filter archive through bzip2, use to decompress .bz2 files
.TP
.B -p, --preserve-permissions
extract all protection information
.TP
.B -v, --verbose
verbosely list files processed
.TP
.B -z, --gzip, --ungzip
filter the archive through gzip
.SH "ALL OPTIONS"
.TP
.B --atime-preserve
don't change access times on dumped files
.TP
.B -b, --blocking-factor N
block size of Nx512 bytes (default N=20)
.TP
.B -B, --read-full-blocks
reblock as we read (for reading 4.2BSD pipes)
.TP
.B --backup BACKUP-TYPE
backup files instead of deleting them using BACKUP-TYPE simple or
numbered
.TP
.B --block-compress
block the output of compression program for tapes
.TP
.B -C, --directory DIR
change to directory DIR
.TP
.B --check-links
warn if number of hard links to the file on the filesystem mismatch the
number of links recorded in the archive
.TP
.B --checkpoint
print directory names while reading the archive
.TP
.B -f, --file [HOSTNAME:]F
use archive file or device F (default "-", meaning stdin/stdout)
.TP
.B -F, --info-script F --new-volume-script F
run script at end of each tape (implies \fI--multi-volume\fR)
.TP
.B --force-local
archive file is local even if has a colon
.TP
.B --format FORMAT
selects output archive format
.nf
\fIv7\fR - Unix V7
\fIoldgnu\fR - GNU tar <=1.12
\fIgnu\fR - GNU tar 1.13
\fIustar\fR - POSIX.1-1988
\fIposix\fR - POSIX.1-2001
.fi
.TP
.B -g, --listed-incremental F
create/list/extract new GNU-format incremental backup
.TP
.B -G, --incremental
create/list/extract old GNU-format incremental backup
.TP
.B -h, --dereference
don't dump symlinks; dump the files they point to
.TP
.B --help
like this manpage, but not as cool
.TP
.B -i, --ignore-zeros
ignore blocks of zeros in archive (normally mean EOF)
.TP
.B --ignore-case
ignore case when excluding files
.TP
.B --ignore-failed-read
don't exit with non-zero status on unreadable files
.TP
.B --index-file FILE
send verbose output to FILE instead of stdout
.TP
.B -j, --bzip2
filter archive through bzip2, use to decompress .bz2 files
.TP
.B -k, --keep-old-files
keep existing files; don't overwrite them from archive
.TP
.B -K, --starting-file F
begin at file F in the archive
.TP
.B --keep-newer-files
do not overwrite files which are newer than the archive
.TP
.B -l, --one-file-system
stay in local file system when creating an archive
.TP
.B -L, --tape-length N
change tapes after writing N*1024 bytes
.TP
.B -m, --touch, --modification-time
don't extract file modified time
.TP
.B -M, --multi-volume
create/list/extract multi-volume archive
.TP
.B --mode PERMISSIONS
apply PERMISSIONS while adding files (see \fBchmod\fR(1))
.TP
.B -N, --after-date DATE, --newer DATE
only store files newer than DATE
.TP
.B --newer-mtime DATE
like \fI--newer\fR, but with a DATE
.TP
.B --no-anchored
match any subsequenceof the name's components with \fI--exclude\fR
.TP
.B --no-ignore-case
use case-sensitive matching with \fI--exclude\fR
.TP
.B --no-recursion
don't recurse into directories
.TP
.B --no-same-permissions
apply user's umask when extracting files instead of recorded permissions
.TP
.B --no-wildcards
don't use wildcards with \fI--exclude\fR
.TP
.B --no-wildcards-match-slash
wildcards do not match slashes (/) with \fI--exclude\fR
.TP
.B --null
\fI--files-from\fR reads null-terminated names, disable \fI--directory\fR
.TP
.B --numeric-owner
always use numbers for user/group names
.TP
.B -o, --old-archive, --portability
like \fI--format=v7\fR; \fI-o\fR exhibits this behavior when creating an
archive (deprecated behavior)
.TP
.B -o, --no-same-owner
do not attempt to restore ownership when extracting; \fI-o\fR exhibits
this behavior when extracting an archive
.TP
.B -O, --to-stdout
extract files to standard output
.TP
.B --occurrence NUM
process only NUM occurrences of each named file; used with
\fI--delete\fR, \fI--diff\fR, \fI--extract\fR, or \fI--list\fR
.TP
.B --overwrite
overwrite existing files and directory metadata when extracting
.TP
.B --overwrite-dir
overwrite directory metadata when extracting
.TP
.B --owner USER
change owner of extraced files to USER
.TP
.B -p, --same-permissions, --preserve-permissions
extract all protection information
.TP
.B -P, --absolute-names
don't strip leading `/'s from file names
.TP
.B --pax-option KEYWORD-LIST
used only with POSIX.1-2001 archives to modify the way \fBtar\fR handles
extended header keywords
.TP
.B --posix
like \fI--format=posix\fR
.TP
.B --preserve
like \fI--preserve-permissions\fR \fI--same-order\fR
.TP
.B --acls
this option causes \fBtar\fR to store each file's ACLs in the archive.
.TP
.B --selinux
this option causes \fBtar\fR to store each file's SELinux security context information in the archive.
.TP
.B --xattrs
this option causes \fBtar\fR to store each file's extended attributes in the archive. This option also enables \fI--acls\fR and\fI--selinux\fR if they haven't been set already, due to the fact that the data for those are stored in special xattrs.
.TP
.B --no-acls
This option causes \fBtar\fR not to store each file's ACLs in the archive and not to extract any ACL information in an archive.
.TP
.B --no-selinux
this option causes \fBtar\fR not to store each file's SELinux security context information in the archive and not to extract any SELinux information in an archive.
.TP
.B --no-xattrs
this option causes \fBtar\fR not to store each file's extended attributes in the archive and not to extract any extended attributes in an archive. This option also enables \fI--no-acls\fR and \fI--no-selinux\fR if they haven't been set already.
.TP
.B -R, --record-number
show record number within archive with each message
.TP
.B --record-size SIZE
use SIZE bytes per record when accessing archives
.TP
.B --recursion
recurse into directories
.TP
.B --recursive-unlink
remove existing directories before extracting directories of the same name
.TP
.B --remove-files
remove files after adding them to the archive
.TP
.B --rmt-command CMD
use CMD instead of the default /usr/sbin/rmt
.TP
.B --rsh-command CMD
use remote CMD instead of \fBrsh\fR(1)
.TP
.B -s, --same-order, --preserve-order
list of names to extract is sorted to match archive
.TP
.B -S, --sparse
handle sparse files efficiently
.TP
.B --same-owner
create extracted files with the same ownership
.TP
.B --show-defaults
display the default options used by \fBtar\fR
.TP
.B --show-omitted-dirs
print directories \fBtar\fR skips while operating on an archive
.TP
.B --strip-components NUMBER, --strip-path NUMBER
strip NUMBER of leading components from file names before extraction
(1) tar-1.14 uses --strip-path, tar-1.14.90+ uses --strip-components
.TP
.B --suffix SUFFIX
use SUFFIX instead of default '~' when backing up files
.TP
.B -T, --files-from F
get names to extract or create from file F
.TP
.B --totals
print total bytes written with --create
.TP
.B -U, --unlink-first
remove existing files before extracting files of the same name
.TP
.B --use-compress-program PROG
access the archive through PROG which is generally a compression program
.TP
.B --utc
display file modification dates in UTC
.TP
.B -v, --verbose
verbosely list files processed
.TP
.B -V, --label NAME
create archive with volume name NAME
.TP
.B --version
print \fBtar\fR program version number
.TP
.B --volno-file F
keep track of which volume of a multi-volume archive its working in
FILE; used with \fI--multi-volume\fR
.TP
.B -w, --interactive, --confirmation
ask for confirmation for every action
.TP
.B -W, --verify
attempt to verify the archive after writing it
.TP
.B --wildcards
use wildcards with \fI--exclude\fR
.TP
.B --wildcards-match-slash
wildcards match slashes (/) with \fI--exclude\fR
.TP
.B --exclude PATTERN
exclude files based upon PATTERN
.TP
.B -X, --exclude-from FILE
exclude files listed in FILE
.TP
.B -Z, --compress, --uncompress
filter the archive through compress
.TP
.B -z, --gzip, --gunzip, --ungzip
filter the archive through gzip
.TP
.B --use-compress-program PROG
filter the archive through PROG (which must accept -d)
.TP
.B -[0-7][lmh]
specify drive and density
.SH BUGS
The GNU folks, in general, abhor man pages, and create info documents instead.
The maintainer of \fBtar\fR falls into this category. Thus this man page may
not be complete, nor current, and was included in the Red Hat CVS tree
because man is a great tool :). This man page was first taken from Debian
Linux and has since been loving updated here.
.SH "REPORTING BUGS"
Please report bugs via https://bugzilla.redhat.com
.SH "SEE ALSO"
The full documentation for
.B tar
is maintained as a Texinfo manual. If the
.B info
and
.B tar
programs are properly installed at your site, the command
.IP
.B info tar
.PP
should give you access to the complete manual.
.SH "AUTHORS"
.nf
Debian Linux http://www.debian.org/
Mike Frysinger <vapier@gentoo.org>
.fi
|