summaryrefslogtreecommitdiff
path: root/archivers/gtar-base/files/gtar.1
blob: 1ecce96a48141d4bb3777cd6d4e5623a94721ced (plain)
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
.\"
.\" $NetBSD: gtar.1,v 1.5 2014/03/12 13:32:14 fhajny Exp $
.TH TAR "1" "March 2014" "tar 1.27.1" "User Commands"
.SH NAME
tar \- The GNU version of the tar archiving utility
.SH SYNOPSIS
.B tar
[\fIOPTION\fR...] [\fIFILE\fR]...
.SH DESCRIPTION
GNU 'tar' saves many files together into a single tape or disk archive, and can
restore individual files from the archive.
.SH EXAMPLES
.TP
tar \-cf archive.tar foo bar
# Create archive.tar from files foo and bar.
.TP
tar \-tvf archive.tar
# List all files in archive.tar verbosely.
.TP
tar \-xf archive.tar
# Extract all files from archive.tar.
.IP
Main operation mode:
.TP
\-A, \-\-catenate, \-\-concatenate
append tar files to an archive
.TP
\-c, \-\-create
create a new archive
.TP
\-d, \-\-diff, \-\-compare
find differences between archive and file system
.TP
\-\-delete
delete from the archive (not on mag tapes!)
.TP
\-r, \-\-append
append files to the end of an archive
.TP
\-t, \-\-list
list the contents of an archive
.TP
\-\-test\-label
test the archive volume label and exit
.TP
\-u, \-\-update
only append files newer than copy in archive
.TP
\-x, \-\-extract, \-\-get
extract files from an archive
.IP
Operation modifiers:
.TP
\-\-check\-device
check device numbers when creating incremental
archives (default)
.TP
\-g, \-\-listed\-incremental=FILE
handle new GNU\-format incremental backup
.TP
\-G, \-\-incremental
handle old GNU\-format incremental backup
.TP
\-\-ignore\-failed\-read
do not exit with nonzero on unreadable files
.TP
\-\-level=NUMBER
dump level for created listed\-incremental archive
.TP
\-n, \-\-seek
archive is seekable
.TP
\-\-no\-check\-device
do not check device numbers when creating
incremental archives
.TP
\-\-no\-seek
archive is not seekable
.TP
\-\-occurrence[=NUMBER]
process only the NUMBERth occurrence of each file
in the archive; this option is valid only in
conjunction with one of the subcommands \-\-delete,
\-\-diff, \-\-extract or \-\-list and when a list of
files is given either on the command line or via
the \-T option; NUMBER defaults to 1
.TP
\-\-sparse\-version=MAJOR[.MINOR]
set version of the sparse format to use (implies
\-\-sparse)
.TP
\-S, \-\-sparse
handle sparse files efficiently
.IP
Overwrite control:
.TP
\-k, \-\-keep\-old\-files
don't replace existing files when extracting,
treat them as errors
.TP
\-\-keep\-directory\-symlink
preserve existing symlinks to directories when
extracting
.TP
\-\-keep\-newer\-files
don't replace existing files that are newer than
their archive copies
.TP
\-\-no\-overwrite\-dir
preserve metadata of existing directories
.TP
\-\-overwrite
overwrite existing files when extracting
.TP
\-\-overwrite\-dir
overwrite metadata of existing directories when
extracting (default)
.TP
\-\-recursive\-unlink
empty hierarchies prior to extracting directory
.TP
\-\-remove\-files
remove files after adding them to the archive
.TP
\-\-skip\-old\-files
don't replace existing files when extracting,
silently skip over them
.TP
\-U, \-\-unlink\-first
remove each file prior to extracting over it
.TP
\-W, \-\-verify
attempt to verify the archive after writing it
.IP
Select output stream:
.HP
\-\-ignore\-command\-error ignore exit codes of children
.TP
\-\-no\-ignore\-command\-error
treat non\-zero exit codes of children as
error
.TP
\-O, \-\-to\-stdout
extract files to standard output
.TP
\-\-to\-command=COMMAND
pipe extracted files to another program
.IP
Handling of file attributes:
.TP
\-\-atime\-preserve[=METHOD]
preserve access times on dumped files, either
by restoring the times after reading
(METHOD='replace'; default) or by not setting the
times in the first place (METHOD='system')
.TP
\-\-delay\-directory\-restore
delay setting modification times and
permissions of extracted directories until the end
of extraction
.TP
\-\-group=NAME
force NAME as group for added files
.TP
\-\-mode=CHANGES
force (symbolic) mode CHANGES for added files
.TP
\-\-mtime=DATE\-OR\-FILE
set mtime for added files from DATE\-OR\-FILE
.TP
\-m, \-\-touch
don't extract file modified time
.TP
\-\-no\-delay\-directory\-restore
cancel the effect of \-\-delay\-directory\-restore
option
.TP
\-\-no\-same\-owner
extract files as yourself (default for ordinary
users)
.TP
\-\-no\-same\-permissions
apply the user's umask when extracting permissions
from the archive (default for ordinary users)
.TP
\-\-numeric\-owner
always use numbers for user/group names
.TP
\-\-owner=NAME
force NAME as owner for added files
.TP
\-p, \-\-preserve\-permissions, \-\-same\-permissions
extract information about file permissions
(default for superuser)
.TP
\-\-preserve
same as both \-p and \-s
.TP
\-\-same\-owner
try extracting files with the same ownership as
exists in the archive (default for superuser)
.TP
\-s, \-\-preserve\-order, \-\-same\-order
member arguments are listed in the same order as
the files in the archive
.IP
Handling of extended file attributes:
.TP
\-\-acls
Enable the POSIX ACLs support
.TP
\-\-no\-acls
Disable the POSIX ACLs support
.TP
\-\-no\-selinux
Disable the SELinux context support
.TP
\-\-no\-xattrs
Disable extended attributes support
.TP
\-\-selinux
Enable the SELinux context support
.TP
\-\-xattrs
Enable extended attributes support
.TP
\-\-xattrs\-exclude=MASK
specify the exclude pattern for xattr keys
.TP
\-\-xattrs\-include=MASK
specify the include pattern for xattr keys
.IP
Device selection and switching:
.TP
\-f, \-\-file=ARCHIVE
use archive file or device ARCHIVE
.TP
\-\-force\-local
archive file is local even if it has a colon
.TP
\-F, \-\-info\-script=NAME, \-\-new\-volume\-script=NAME
run script at end of each tape (implies \-M)
.TP
\-L, \-\-tape\-length=NUMBER
change tape after writing NUMBER x 1024 bytes
.TP
\-M, \-\-multi\-volume
create/list/extract multi\-volume archive
.TP
\-\-rmt\-command=COMMAND
use given rmt COMMAND instead of rmt
.TP
\-\-rsh\-command=COMMAND
use remote COMMAND instead of rsh
.TP
\-\-volno\-file=FILE
use/update the volume number in FILE
.IP
Device blocking:
.TP
\-b, \-\-blocking\-factor=BLOCKS
BLOCKS x 512 bytes per record
.TP
\-B, \-\-read\-full\-records
reblock as we read (for 4.2BSD pipes)
.TP
\-i, \-\-ignore\-zeros
ignore zeroed blocks in archive (means EOF)
.TP
\-\-record\-size=NUMBER
NUMBER of bytes per record, multiple of 512
.IP
Archive format selection:
.TP
\-H, \-\-format=FORMAT
create archive of the given format
.IP
FORMAT is one of the following:
.TP
gnu
GNU tar 1.13.x format
.TP
oldgnu
GNU format as per tar <= 1.12
.TP
pax
POSIX 1003.1\-2001 (pax) format
.TP
posix
same as pax
.TP
ustar
POSIX 1003.1\-1988 (ustar) format
.TP
v7
old V7 tar format
.TP
\-\-old\-archive, \-\-portability
same as \-\-format=v7
.TP
\-\-pax\-option=keyword[[:]=value][,keyword[[:]=value]]...
control pax keywords
.TP
\-\-posix
same as \-\-format=posix
.TP
\-V, \-\-label=TEXT
create archive with volume name TEXT; at
list/extract time, use TEXT as a globbing pattern
for volume name
.IP
Compression options:
.TP
\-a, \-\-auto\-compress
use archive suffix to determine the compression
program
.TP
\-I, \-\-use\-compress\-program=PROG
filter through PROG (must accept \-d)
.TP
\-j, \-\-bzip2
filter the archive through bzip2
.TP
\-J, \-\-xz
filter the archive through xz
.TP
\-\-lzip
filter the archive through lzip
.TP
\-\-lzma
filter the archive through lzma
.HP
\-\-lzop
.TP
\-\-no\-auto\-compress
do not use archive suffix to determine the
compression program
.TP
\-z, \-\-gzip, \-\-gunzip, \-\-ungzip
filter the archive through gzip
.TP
\-Z, \-\-compress, \-\-uncompress
filter the archive through compress
.IP
Local file selection:
.TP
\-\-add\-file=FILE
add given FILE to the archive (useful if its name
starts with a dash)
.TP
\-\-backup[=CONTROL]
backup before removal, choose version CONTROL
.TP
\-C, \-\-directory=DIR
change to directory DIR
.TP
\-\-exclude=PATTERN
exclude files, given as a PATTERN
.TP
\-\-exclude\-backups
exclude backup and lock files
.TP
\-\-exclude\-caches
exclude contents of directories containing
CACHEDIR.TAG, except for the tag file itself
.TP
\-\-exclude\-caches\-all
exclude directories containing CACHEDIR.TAG
.TP
\-\-exclude\-caches\-under exclude everything under directories containing
CACHEDIR.TAG
.TP
\-\-exclude\-tag=FILE
exclude contents of directories containing FILE,
except for FILE itself
.HP
\-\-exclude\-tag\-all=FILE exclude directories containing FILE
.TP
\-\-exclude\-tag\-under=FILE
exclude everything under directories
containing FILE
.TP
\-\-exclude\-vcs
exclude version control system directories
.TP
\-h, \-\-dereference
follow symlinks; archive and dump the files they
point to
.TP
\-\-hard\-dereference
follow hard links; archive and dump the files they
refer to
.TP
\-K, \-\-starting\-file=MEMBER\-NAME
begin at member MEMBER\-NAME when reading the
archive
.TP
\-\-newer\-mtime=DATE
compare date and time when data changed only
.TP
\-\-no\-null
disable the effect of the previous \-\-null option
.TP
\-\-no\-recursion
avoid descending automatically in directories
.TP
\-\-no\-unquote
do not unquote filenames read with \-T
.HP
\-\-null                 \-T reads null\-terminated names, disable \-C
.TP
\-N, \-\-newer=DATE\-OR\-FILE, \-\-after\-date=DATE\-OR\-FILE
only store files newer than DATE\-OR\-FILE
.TP
\-\-one\-file\-system
stay in local file system when creating archive
.TP
\-P, \-\-absolute\-names
don't strip leading '/'s from file names
.TP
\-\-recursion
recurse into directories (default)
.TP
\-\-suffix=STRING
backup before removal, override usual suffix ('~'
unless overridden by environment variable
SIMPLE_BACKUP_SUFFIX)
.TP
\-T, \-\-files\-from=FILE
get names to extract or create from FILE
.TP
\-\-unquote
unquote filenames read with \-T (default)
.TP
\-X, \-\-exclude\-from=FILE
exclude patterns listed in FILE
.IP
File name transformations:
.TP
\-\-strip\-components=NUMBER
strip NUMBER leading components from file
names on extraction
.TP
\-\-transform=EXPRESSION, \-\-xform=EXPRESSION
use sed replace EXPRESSION to transform file
names
.IP
File name matching options (affect both exclude and include patterns):
.TP
\-\-anchored
patterns match file name start
.TP
\-\-ignore\-case
ignore case
.TP
\-\-no\-anchored
patterns match after any '/' (default for
exclusion)
.TP
\-\-no\-ignore\-case
case sensitive matching (default)
.TP
\-\-no\-wildcards
verbatim string matching
.TP
\-\-no\-wildcards\-match\-slash
wildcards do not match '/'
.TP
\-\-wildcards
use wildcards (default for exclusion)
.TP
\-\-wildcards\-match\-slash
wildcards match '/' (default for exclusion)
.IP
Informative output:
.TP
\-\-checkpoint[=NUMBER]
display progress messages every NUMBERth record
(default 10)
.TP
\-\-checkpoint\-action=ACTION
execute ACTION on each checkpoint
.TP
\-\-full\-time
print file time to its full resolution
.TP
\-\-index\-file=FILE
send verbose output to FILE
.TP
\-l, \-\-check\-links
print a message if not all links are dumped
.TP
\-\-no\-quote\-chars=STRING
disable quoting for characters from STRING
.TP
\-\-quote\-chars=STRING
additionally quote characters from STRING
.TP
\-\-quoting\-style=STYLE
set name quoting style; see below for valid STYLE
values
.TP
\-R, \-\-block\-number
show block number within archive with each message
.TP
\-\-show\-defaults
show tar defaults
.TP
\-\-show\-omitted\-dirs
when listing or extracting, list each directory
that does not match search criteria
.TP
\-\-show\-snapshot\-field\-ranges
show valid ranges for snapshot\-file fields
.TP
\-\-show\-transformed\-names, \-\-show\-stored\-names
show file or archive names after transformation
.TP
\-\-totals[=SIGNAL]
print total bytes after processing the archive;
with an argument \- print total bytes when this
SIGNAL is delivered; Allowed signals are: SIGHUP,
SIGQUIT, SIGINT, SIGUSR1 and SIGUSR2; the names
without SIG prefix are also accepted
.TP
\-\-utc
print file modification times in UTC
.TP
\-v, \-\-verbose
verbosely list files processed
.TP
\-\-warning=KEYWORD
warning control
.TP
\-w, \-\-interactive, \-\-confirmation
ask for confirmation for every action
.IP
Compatibility options:
.TP
\-o
when creating, same as \-\-old\-archive; when
extracting, same as \-\-no\-same\-owner
.IP
Other options:
.TP
\-?, \-\-help
give this help list
.TP
\-\-restrict
disable use of some potentially harmful options
.TP
\-\-usage
give a short usage message
.TP
\-\-version
print program version
.PP
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
.PP
The backup suffix is '~', unless set with \-\-suffix or SIMPLE_BACKUP_SUFFIX.
The version control may be set with \-\-backup or VERSION_CONTROL, values are:
.TP
none, off
never make backups
.TP
t, numbered
make numbered backups
.TP
nil, existing
numbered if numbered backups exist, simple otherwise
.TP
never, simple
always make simple backups
.PP
Valid arguments for the \-\-quoting\-style option are:
.IP
literal
shell
shell\-always
c
c\-maybe
escape
locale
clocale
.PP
*This* tar defaults to:
\-\-format=gnu \-f\- \-b20 \-\-quoting\-style=escape
\-\-rmt\-command=/opt/local/libexec/grmt \-\-rsh\-command=/usr/bin/rsh
.SH AUTHOR
Written by John Gilmore and Jay Fenlason.
.SH "REPORTING BUGS"
Report bugs to <bug\-tar@gnu.org>.
.SH COPYRIGHT
Copyright \(co 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
.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.