Blame


1 d93fca6a 2005-02-11 devnull .TH TAR 1
2 d93fca6a 2005-02-11 devnull .SH NAME
3 d93fca6a 2005-02-11 devnull tar \- archiver
4 d93fca6a 2005-02-11 devnull .SH SYNOPSIS
5 d93fca6a 2005-02-11 devnull .B tar
6 d93fca6a 2005-02-11 devnull .I key
7 d93fca6a 2005-02-11 devnull [
8 d93fca6a 2005-02-11 devnull .I file ...
9 d93fca6a 2005-02-11 devnull ]
10 d93fca6a 2005-02-11 devnull .SH DESCRIPTION
11 d93fca6a 2005-02-11 devnull .PP
12 d93fca6a 2005-02-11 devnull .I Tar
13 d93fca6a 2005-02-11 devnull saves and restores file trees.
14 d93fca6a 2005-02-11 devnull It is most often used to transport a tree of files from one
15 d93fca6a 2005-02-11 devnull system to another.
16 d93fca6a 2005-02-11 devnull The
17 d93fca6a 2005-02-11 devnull .I key
18 d93fca6a 2005-02-11 devnull is a string that contains
19 d93fca6a 2005-02-11 devnull at most one function letter plus optional modifiers.
20 d93fca6a 2005-02-11 devnull Other arguments to the command are names of
21 d93fca6a 2005-02-11 devnull files or directories to be dumped or restored.
22 d93fca6a 2005-02-11 devnull A directory name implies all the contained
23 d93fca6a 2005-02-11 devnull files and subdirectories (recursively).
24 d93fca6a 2005-02-11 devnull .PP
25 d93fca6a 2005-02-11 devnull The function is one of the following letters:
26 d93fca6a 2005-02-11 devnull .TP
27 d93fca6a 2005-02-11 devnull .B c
28 d93fca6a 2005-02-11 devnull Create a new archive with the given files as contents.
29 d93fca6a 2005-02-11 devnull .TP
30 d93fca6a 2005-02-11 devnull .B r
31 d93fca6a 2005-02-11 devnull The named files
32 d93fca6a 2005-02-11 devnull are appended to the archive.
33 d93fca6a 2005-02-11 devnull .TP
34 d93fca6a 2005-02-11 devnull .B t
35 d93fca6a 2005-02-11 devnull List all occurrences of each
36 d93fca6a 2005-02-11 devnull .I file
37 d93fca6a 2005-02-11 devnull in the archive, or of all files if there are no
38 d93fca6a 2005-02-11 devnull .I file
39 d93fca6a 2005-02-11 devnull arguments.
40 d93fca6a 2005-02-11 devnull .TP
41 d93fca6a 2005-02-11 devnull .B x
42 d93fca6a 2005-02-11 devnull Extract the named files from the archive.
43 d93fca6a 2005-02-11 devnull If a file is a directory, the directory is extracted recursively.
44 d93fca6a 2005-02-11 devnull Modes are restored if possible.
45 d93fca6a 2005-02-11 devnull If no file argument is given, extract the entire archive.
46 d93fca6a 2005-02-11 devnull If the archive contains multiple entries for a file,
47 d93fca6a 2005-02-11 devnull the latest one wins.
48 d93fca6a 2005-02-11 devnull .PP
49 d93fca6a 2005-02-11 devnull The modifiers are:
50 d93fca6a 2005-02-11 devnull .TP
51 d93fca6a 2005-02-11 devnull .B f
52 d93fca6a 2005-02-11 devnull Use the next argument as the name of the archive instead of
53 d93fca6a 2005-02-11 devnull the default standard input (for keys
54 d93fca6a 2005-02-11 devnull .B x
55 d93fca6a 2005-02-11 devnull and
56 d93fca6a 2005-02-11 devnull .BR t )
57 d93fca6a 2005-02-11 devnull or standard output (for keys
58 d93fca6a 2005-02-11 devnull .B c
59 d93fca6a 2005-02-11 devnull and
60 d93fca6a 2005-02-11 devnull .BR r ).
61 d93fca6a 2005-02-11 devnull .TP
62 d93fca6a 2005-02-11 devnull .B g
63 d93fca6a 2005-02-11 devnull Use the next (numeric) argument as the group id for files in
64 d93fca6a 2005-02-11 devnull the output archive.
65 d93fca6a 2005-02-11 devnull .TP
66 d93fca6a 2005-02-11 devnull .B k
67 d93fca6a 2005-02-11 devnull (keep)
68 d93fca6a 2005-02-11 devnull Modifies the behavior of
69 d93fca6a 2005-02-11 devnull .B x
70 d93fca6a 2005-02-11 devnull not to extract files which already exist.
71 d93fca6a 2005-02-11 devnull .TP
72 d93fca6a 2005-02-11 devnull .B m
73 d93fca6a 2005-02-11 devnull Do not set the modification time on extracted files.
74 d93fca6a 2005-02-11 devnull This is the default behavior; the flag exists only for compatibility with other tars.
75 d93fca6a 2005-02-11 devnull .TP
76 d93fca6a 2005-02-11 devnull .B p
77 d93fca6a 2005-02-11 devnull Create archive in POSIX ustar format,
78 d93fca6a 2005-02-11 devnull which raises the maximum pathname length from 100 to 256 bytes.
79 d93fca6a 2005-02-11 devnull Ustar archives are recognised automatically by
80 d93fca6a 2005-02-11 devnull .I tar
81 d93fca6a 2005-02-11 devnull when reading archives.
82 d93fca6a 2005-02-11 devnull This is the default behavior; the flag exists only for backwards compatibility
83 d93fca6a 2005-02-11 devnull with older versions of tar.
84 d93fca6a 2005-02-11 devnull .TP
85 d93fca6a 2005-02-11 devnull .B P
86 d93fca6a 2005-02-11 devnull Do not generate the POSIX ustar format.
87 d93fca6a 2005-02-11 devnull .TP
88 d93fca6a 2005-02-11 devnull .B R
89 d93fca6a 2005-02-11 devnull When extracting, ignore leading slash on file names,
90 d93fca6a 2005-02-11 devnull i.e., extract all files relative to the current directory.
91 d93fca6a 2005-02-11 devnull .TP
92 d93fca6a 2005-02-11 devnull .B T
93 d93fca6a 2005-02-11 devnull Modifies the behavior of
94 d93fca6a 2005-02-11 devnull .B x
95 d93fca6a 2005-02-11 devnull to set the modified time
96 d93fca6a 2005-02-11 devnull of each file to that specified in the archive.
97 d93fca6a 2005-02-11 devnull .TP
98 d93fca6a 2005-02-11 devnull .B u
99 d93fca6a 2005-02-11 devnull Use the next (numeric) argument as the user id for files in
100 d93fca6a 2005-02-11 devnull the output archive. This is only useful when moving files to
101 d93fca6a 2005-02-11 devnull a non-Plan 9 system.
102 d93fca6a 2005-02-11 devnull .TP
103 d93fca6a 2005-02-11 devnull .B v
104 d93fca6a 2005-02-11 devnull (verbose)
105 d93fca6a 2005-02-11 devnull Print the name of each file treated
106 d93fca6a 2005-02-11 devnull preceded by the function letter.
107 d93fca6a 2005-02-11 devnull With
108 d93fca6a 2005-02-11 devnull .BR t ,
109 d93fca6a 2005-02-11 devnull give more details about the
110 d93fca6a 2005-02-11 devnull archive entries.
111 d93fca6a 2005-02-11 devnull .TP
112 d93fca6a 2005-02-11 devnull .B z
113 d93fca6a 2005-02-11 devnull Operate on compressed tar archives.
114 d93fca6a 2005-02-11 devnull The type of compression is inferred from the file name extension:
115 d32deab1 2020-08-16 rsc .MR gzip (1)
116 d93fca6a 2005-02-11 devnull for
117 d93fca6a 2005-02-11 devnull .B .tar.gz
118 d93fca6a 2005-02-11 devnull and
119 d93fca6a 2005-02-11 devnull .BR .tgz ;
120 d93fca6a 2005-02-11 devnull .I bzip2
121 d93fca6a 2005-02-11 devnull (see
122 d32deab1 2020-08-16 rsc .MR gzip (1) )
123 d93fca6a 2005-02-11 devnull for
124 d93fca6a 2005-02-11 devnull .BR .tar.bz ,
125 d93fca6a 2005-02-11 devnull .BR .tbz ,
126 d93fca6a 2005-02-11 devnull .BR .tar.bz2 ,
127 d93fca6a 2005-02-11 devnull and
128 d93fca6a 2005-02-11 devnull .BR .tbz2 ;
129 d93fca6a 2005-02-11 devnull .I compress
130 d93fca6a 2005-02-11 devnull for
131 d93fca6a 2005-02-11 devnull .B .tar.Z
132 d93fca6a 2005-02-11 devnull and
133 d93fca6a 2005-02-11 devnull .BR .tz .
134 d93fca6a 2005-02-11 devnull If no extension matches,
135 d93fca6a 2005-02-11 devnull .I gzip
136 d93fca6a 2005-02-11 devnull is used.
137 d93fca6a 2005-02-11 devnull The
138 d93fca6a 2005-02-11 devnull .B z
139 d93fca6a 2005-02-11 devnull flag is unnecessary (but allowed) when using the
140 d93fca6a 2005-02-11 devnull .B t
141 d93fca6a 2005-02-11 devnull and
142 d93fca6a 2005-02-11 devnull .B x
143 d93fca6a 2005-02-11 devnull verbs on archives with recognized extensions.
144 d93fca6a 2005-02-11 devnull .SH EXAMPLES
145 d93fca6a 2005-02-11 devnull .I Tar
146 d93fca6a 2005-02-11 devnull can be used to copy hierarchies thus:
147 d93fca6a 2005-02-11 devnull .IP
148 d93fca6a 2005-02-11 devnull .EX
149 d93fca6a 2005-02-11 devnull @{cd fromdir && tar cp .} | @{cd todir && tar xT}
150 d93fca6a 2005-02-11 devnull .EE
151 d93fca6a 2005-02-11 devnull .SH SOURCE
152 d93fca6a 2005-02-11 devnull .B \*9/src/cmd/tar.c
153 d93fca6a 2005-02-11 devnull .SH SEE ALSO
154 83c4506a 2005-02-11 devnull .I 9ar
155 83c4506a 2005-02-11 devnull in
156 d32deab1 2020-08-16 rsc .MR 9c (1) ,
157 d32deab1 2020-08-16 rsc .MR bundle (1)
158 d93fca6a 2005-02-11 devnull .SH BUGS
159 d93fca6a 2005-02-11 devnull There is no way to ask for any but the last
160 d93fca6a 2005-02-11 devnull occurrence of a file.
161 83c4506a 2005-02-11 devnull .PP
162 d93fca6a 2005-02-11 devnull File path names are limited to
163 d93fca6a 2005-02-11 devnull 100 characters
164 d93fca6a 2005-02-11 devnull (256 when using ustar format).
165 83c4506a 2005-02-11 devnull .PP
166 d93fca6a 2005-02-11 devnull The tar format allows specification of links and symbolic links,
167 d93fca6a 2005-02-11 devnull concepts foreign to Plan 9: they are ignored.