-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtar.cat1
220 lines (169 loc) · 11.1 KB
/
tar.cat1
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
TAR(1) NetBSD General Commands Manual TAR(1)
NNAAMMEE
ttaarr - tape archiver
SSYYNNOOPPSSIISS
ttaarr [-]{crtux}[--bbeeffhhjjkkllmmooppqqvvwwzzHHLLOOPPXXZZ001144557788] [_a_r_c_h_i_v_e] [_b_l_o_c_k_s_i_z_e]
[--CC _d_i_r_e_c_t_o_r_y] [--TT _f_i_l_e] [--ss _r_e_p_l_s_t_r] [_f_i_l_e _._._.]
DDEESSCCRRIIPPTTIIOONN
The ttaarr command creates, adds files to, or extracts files from an archive
file in ``tar'' format. A tar archive is often stored on a magnetic
tape, but can be stored equally well on a floppy, CD-ROM, or in a regular
disk file.
One of the following flags must be present:
--cc, ----ccrreeaattee Create new archive, or overwrite an existing archive,
adding the specified files to it.
--rr, ----aappppeenndd Append the named new files to existing archive. Note that
this will only work on media on which an end-of-file mark
can be overwritten.
--tt, ----lliisstt List contents of archive. If any files are named on the
command line, only those files will be listed.
--uu, ----uuppddaattee Alias for --rr.
--xx, ----eexxttrraacctt, ----ggeett
Extract files from archive. If any files are named on the
command line, only those files will be extracted from the
archive. If more than one copy of a file exists in the ar-
chive, later copies will overwrite earlier copies during
extraction. The file mode and modification time are pre-
served if possible. The file mode is subject to modifica-
tion by the umask(2).
In addition to the flags mentioned above, any of the following flags may
be used:
--bb _b_l_o_c_k_i_n_g _f_a_c_t_o_r, ----bblloocckk--ssiizzee _b_l_o_c_k_i_n_g _f_a_c_t_o_r
Set blocking factor to use for the archive. ttaarr uses 512
byte blocks. The default is 20, the maximum is 126. Ar-
chives with a blocking factor larger 63 violate the POSIX
standard and will not be portable to all systems.
--ee Stop after first error.
--ff _a_r_c_h_i_v_e, ----ffiillee _a_r_c_h_i_v_e
Filename where the archive is stored. Defaults to
_/_d_e_v_/_r_s_t_0. If the archive is of the form:
_[_[_u_s_e_r_@_]_h_o_s_t_:_]_f_i_l_e then the archive will be processed using
rmt(8).
--hh, ----ddeerreeffeerreennccee
Follow symbolic links as if they were normal files or
directories.
--jj,, ----bbzziipp22,, ----bbuunnzziipp22
Use bzip2(1) for compression of the archive. This option
is a GNU extension.
--kk, ----kkeeeepp--oolldd--ffiilleess
Keep existing files; don't overwrite them from archive.
--ll, ----oonnee--ffiillee--ssyysstteemm
Do not cross filesystems.
--mm, ----mmooddiiffiiccaattiioonn--ttiimmee
Do not preserve modification time.
--OO When creating and appending to an archive, write old-style
(non-POSIX) archives. When extracting from an archive,
extract to standard output.
--oo, ----ppoorrttaabbiilliittyy, ----oolldd--aarrcchhiivvee
Don't write directory information that the older (V7) style
ttaarr is unable to decode. This implies the --OO flag.
--pp, ----pprreesseerrvvee--ppeerrmmiissssiioonnss, ----pprreesseerrvvee
Preserve user and group ID as well as file mode regardless
of the current umask(2). The setuid and setgid bits are
only preserved if the user is the superuser. Only meaning-
ful in conjunction with the --xx flag.
--qq, ----ffaasstt--rreeaadd
Select the first archive member that matches each _p_a_t_t_e_r_n
operand. No more than one archive member is matched for
each _p_a_t_t_e_r_n. When members of type directory are matched,
the file hierarchy rooted at that directory is also
matched.
--ss _r_e_p_l_s_t_r Modify the file or archive member names specified by the
_p_a_t_t_e_r_n or _f_i_l_e operands according to the substitution
expression _r_e_p_l_s_t_r, using the syntax of the ed(1) utility
regular expressions. The format of these regular expres-
sions are:
/old/new/[gp]
As in ed(1), oolldd is a basic regular expression and nneeww can
contain an ampersand (&), \n (where n is a digit) back-ref-
erences, or subexpression matching. The oolldd string may
also contain <newline> characters. Any non-null character
can be used as a delimiter (/ is shown here). Multiple --ss
expressions can be specified. The expressions are applied
in the order they are specified on the command line, termi-
nating with the first successful substitution. The
optional trailing gg continues to apply the substitution
expression to the pathname substring which starts with the
first character following the end of the last successful
substitution. The first unsuccessful substitution stops
the operation of the gg option. The optional trailing pp
will cause the final result of a successful substitution to
be written to standard error in the following format:
<original pathname> >> <new pathname>
File or archive member names that substitute to the empty
string are not selected and will be skipped.
--vv Verbose operation mode.
--ww, ----iinntteerraaccttiivvee, ----ccoonnffiirrmmaattiioonn
Interactively rename files. This option causes ttaarr to
prompt the user for the filename to use when storing or
extracting files in an archive.
--zz, ----ggzziipp, ----gguunnzziipp
Compress archive using gzip.
--BB, ----rreeaadd--ffuullll--bblloocckkss
Reassemble small reads into full blocks (For reading from
4.2BSD pipes).
--CC _d_i_r_e_c_t_o_r_y, ----ddiirreeccttoorryy _d_i_r_e_c_t_o_r_y
This is a positional argument which sets the working direc-
tory for the following files. When extracting, files will
be extracted into the specified directory; when creating,
the specified files will be matched from the directory.
This argument and its parameter may also appear in a file
list specified by --TT.
--HH Follow symlinks given on command line only.
--PP, ----aabbssoolluuttee--ppaatthhss
Do not strip leading slashes (`/') from pathnames. The
default is to strip leading slashes.
--TT _f_i_l_e, ----ffiilleess--ffrroomm _f_i_l_e
Read the names of files to archive or extract from the
given file, one per line. A line may also specify the
positional argument ``--CC _d_i_r_e_c_t_o_r_y''.
--XX _f_i_l_e, ----eexxcclluuddee--ffrroomm _f_i_l_e
Exclude files listed in the given file.
--ZZ, ----ccoommpprreessss, ----uunnccoommpprreessss
Compress archive using compress.
----ssttrriicctt Do not enable GNU tar extensions such as long filenames and
long link names.
----aattiimmee--pprreesseerrvvee
Preserve file access times.
----uunnlliinnkk Ignored, only accepted for compatibility with other ttaarr
implementations. ttaarr always unlinks files before creating
them.
----uussee--ccoommpprreessss--pprrooggrraamm _p_r_o_g_r_a_m
Use the named program as the program to decompress the
input.
----ffoorrccee--llooccaall
Do not interpret filenames that contain a `:' as remote
files.
----iinnsseeccuurree Normally ttaarr ignores filenames that contain `..' as a path
component. With this option, files that contain `..' can
be processed.
The options [--001144557788] can be used to select one of the compiled-in backup
devices, _/_d_e_v_/_r_s_t_N.
FFIILLEESS
/dev/rst0 default archive name
DDIIAAGGNNOOSSTTIICCSS
ttaarr will exit with one of the following values:
0 All files were processed successfully.
1 An error occurred.
Whenever ttaarr cannot create a file or a link when extracting an archive or
cannot find a file while writing an archive, or cannot preserve the user
ID, group ID, file mode, or access and modification times when the --pp
option is specified, a diagnostic message is written to standard error
and a non-zero exit value will be returned, but processing will continue.
In the case where ttaarr cannot create a link to a file, ttaarr will not create
a second copy of the file.
If the extraction of a file from an archive is prematurely terminated by
a signal or error, ttaarr may have only partially extracted the file the
user wanted. Additionally, the file modes of extracted files and direc-
tories may have incorrect file bits, and the modification and access
times may be wrong.
If the creation of an archive is prematurely terminated by a signal or
error, ttaarr may have only partially created the archive which may violate
the specific archive format specification.
SSEEEE AALLSSOO
cpio(1), pax(1)
HHIISSTTOORRYY
A ttaarr command first appeared in Version 7 AT&T UNIX.
AAUUTTHHOORRSS
Keith Muller at the University of California, San Diego.
NetBSD 2.0 May 4, 2004 NetBSD 2.0