]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - usr.bin/unzip/unzip.1
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / usr.bin / unzip / unzip.1
1 .\"-
2 .\" Copyright (c) 2007-2008 Dag-Erling Smørgrav
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 .\" SUCH DAMAGE.
25 .\"
26 .\" $FreeBSD$
27 .\"
28 .Dd May 10, 2012
29 .Dt UNZIP 1
30 .Os
31 .Sh NAME
32 .Nm unzip
33 .Nd extract files from a ZIP archive
34 .Sh SYNOPSIS
35 .Nm
36 .Op Fl aCcfjLlnopqtuv
37 .Op Fl d Ar dir
38 .Ar zipfile
39 .Sh DESCRIPTION
40 .\" ...
41 The following options are available:
42 .Bl -tag -width Fl
43 .It Fl a
44 When extracting a text file, convert DOS-style line endings to
45 Unix-style line endings.
46 .It Fl C
47 Match file names case-insensitively.
48 .It Fl c
49 Extract to stdout/screen.
50 When extracting files from the zipfile, they are written to stdout.
51 This is similar to
52 .Fl p ,
53 but does not suppress normal output.
54 .It Fl d Ar dir
55 Extract files into the specified directory rather than the current
56 directory.
57 .It Fl f
58 Update existing.
59 Extract only files from the zipfile if a file with the same name
60 already exists on disk and is older than the former.
61 Otherwise, the file is silently skipped.
62 .It Fl j
63 Ignore directories stored in the zipfile; instead, extract all files
64 directly into the extraction directory.
65 .It Fl L
66 Convert the names of the extracted files and directories to lowercase.
67 .It Fl l
68 List, rather than extract, the contents of the zipfile.
69 .It Fl n
70 No overwrite.
71 When extracting a file from the zipfile, if a file with the same name
72 already exists on disk, the file is silently skipped.
73 .It Fl o
74 Overwrite.
75 When extracting a file from the zipfile, if a file with the same name
76 already exists on disk, the existing file is replaced with the file
77 from the zipfile.
78 .It Fl p
79 Extract to stdout.
80 When extracting files from the zipfile, they are written to stdout.
81 The normal output is suppressed as if
82 .Fl q
83 was specified.
84 .It Fl q
85 Quiet: print less information while extracting.
86 .It Fl t
87 Test: do not extract anything, but verify the checksum of every file
88 in the archive.
89 .It Fl u
90 Update.
91 When extracting a file from the zipfile, if a file with the same name
92 already exists on disk, the existing file is replaced with the file
93 from the zipfile if and only if the latter is newer than the former.
94 Otherwise, the file is silently skipped.
95 .It Fl v
96 List verbosely, rather than extract, the contents of the zipfile.
97 This differs from
98 .Fl l
99 by using the long listing.
100 Note that most of the data is currently fake and does not reflect the
101 content of the archive.
102 .It Fl x Ar pattern
103 Exclude files matching the pattern
104 .Ar pattern .
105 .It Fl Z Ar mode
106 Emulate
107 .Xr zipinfo 1L
108 mode.
109 Enabling
110 .Xr zipinfo 1L
111 mode changes the way in which additional arguments are parsed.
112 Currently only
113 .Xr zipinfo 1L
114 mode 1 is supported, which lists the file names one per line.
115 .El
116 .Pp
117 Note that only one of
118 .Fl n ,
119 .Fl o ,
120 and
121 .Fl u
122 may be specified.
123 If specified filename is
124 .Qq - ,
125 then data is read from
126 .Va stdin .
127 .Sh ENVIRONMENT
128 If the
129 .Ev UNZIP_DEBUG
130 environment variable is defined, the
131 .Fl q
132 command-line option has no effect, and additional debugging
133 information will be printed to
134 .Va stderr .
135 .Sh COMPATIBILITY
136 The
137 .Nm
138 utility aims to be sufficiently compatible with other implementations
139 to serve as a drop-in replacement in the context of the
140 .Xr ports 7
141 system.
142 No attempt has been made to replicate functionality which is not
143 required for that purpose.
144 .Pp
145 For compatibility reasons, command-line options will be recognized if
146 they are listed not only before but also after the name of the
147 zipfile.
148 .Pp
149 Normally, the
150 .Fl a
151 option should only affect files which are marked as text files in the
152 zipfile's central directory.
153 Since the
154 .Xr archive 3
155 library reads zipfiles sequentially, and does not use the central
156 directory, that information is not available to the
157 .Nm
158 utility.
159 Instead, the
160 .Nm
161 utility will assume that a file is a text file if no non-ASCII
162 characters are present within the first block of data decompressed for
163 that file.
164 If non-ASCII characters appear in subsequent blocks of data, a warning
165 will be issued.
166 .Pp
167 The
168 .Nm
169 utility is only able to process ZIP archives handled by
170 .Xr libarchive 3 .
171 Depending on the installed version of
172 .Xr libarchive ,
173 this may or may not include self-extracting archives.
174 .Sh SEE ALSO
175 .Xr libarchive 3
176 .Sh HISTORY
177 The
178 .Nm
179 utility appeared in
180 .Fx 8.0 .
181 .Sh AUTHORS
182 The
183 .Nm
184 utility and this manual page were written by
185 .An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
186 It uses the
187 .Xr archive 3
188 library developed by
189 .An Tim Kientzle Aq kientzle@FreeBSD.org .