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