]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - usr.bin/unzip/unzip.1
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / usr.bin / unzip / unzip.1
1 .\"-
2 .\" Copyright (c) 2007-2008 Dag-Erling Coïdan 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 February 16, 2010
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 .Pp
42 The following options are available:
43 .Bl -tag -width Fl
44 .It Fl a
45 When extracting a text file, convert DOS-style line endings to
46 Unix-style line endings.
47 .It Fl C
48 Match file names case-insensitively.
49 .It Fl c
50 Extract to stdout/screen.
51 When extracting files from the zipfile, they are written to stdout.
52 This is similar to
53 .Fl p ,
54 but doesn't suppress normal output.
55 .It Fl d Ar dir
56 Extract files into the specified directory rather than the current
57 directory.
58 .It Fl f
59 Update existing.
60 Extract only files from the zipfile if a file with the same name
61 already exists on disk and is older than the former.
62 Otherwise, the file is silently skipped.
63 .It Fl j
64 Ignore directories stored in the zipfile; instead, extract all files
65 directly into the extraction directory.
66 .It Fl L
67 Convert the names of the extracted files and directories to lowercase.
68 .It Fl l
69 List, rather than extract, the contents of the zipfile.
70 .It Fl n
71 No overwrite.
72 When extracting a file from the zipfile, if a file with the same name
73 already exists on disk, the file is silently skipped.
74 .It Fl o
75 Overwrite.
76 When extracting a file from the zipfile, if a file with the same name
77 already exists on disk, the existing file is replaced with the file
78 from the zipfile.
79 .It Fl p
80 Extract to stdout.
81 When extracting files from the zipfile, they are written to stdout.
82 The normal output is suppressed as if
83 .Fl q
84 was specified.
85 .It Fl q
86 Quiet: print less information while extracting.
87 .It Fl t
88 Test: do not extract anything, but verify the checksum of every file
89 in the archive.
90 .It Fl u
91 Update.
92 When extracting a file from the zipfile, if a file with the same name
93 already exists on disk, the existing file is replaced with the file
94 from the zipfile if and only if the latter is newer than the former.
95 Otherwise, the file is silently skipped.
96 .It Fl v
97 List verbosely, rather than extract, the contents of the zipfile.
98 This differs from
99 .Fl l
100 by using the long listing.
101 Note that most of the data is currently fake and does not reflect the
102 content of the archive.
103 .It Fl x Ar pattern
104 Exclude files matching the pattern
105 .Ar pattern .
106 .El
107 .Pp
108 Note that only one of
109 .Fl n ,
110 .Fl o ,
111 and
112 .Fl u
113 may be specified.
114 .Sh ENVIRONMENT
115 If the
116 .Ev UNZIP_DEBUG
117 environment variable is defined, the
118 .Fl q
119 command-line option has no effect, and additional debugging
120 information will be printed to
121 .Va stderr .
122 .Sh COMPATIBILITY
123 The
124 .Nm
125 utility aims to be sufficiently compatible with other implementations
126 to serve as a drop-in replacement in the context of the
127 .Xr ports 7
128 system.
129 No attempt has been made to replicate functionality which is not
130 required for that purpose.
131 .Pp
132 For compatibility reasons, command-line options will be recognized if
133 they are listed not only before but also after the name of the
134 zipfile.
135 .Pp
136 Normally, the
137 .Fl a
138 option should only affect files which are marked as text files in the
139 zipfile's central directory.
140 Since the
141 .Xr archive 3
142 library reads zipfiles sequentially, and does not use the central
143 directory, that information is not available to the
144 .Nm
145 utility.
146 Instead, the
147 .Nm
148 utility will assume that a file is a text file if no non-ASCII
149 characters are present within the first block of data decompressed for
150 that file.
151 If non-ASCII characters appear in subsequent blocks of data, a warning
152 will be issued.
153 .Pp
154 The
155 .Nm
156 utility is only able to process ZIP archives handled by
157 .Xr libarchive 3 .
158 Depending on the installed version of
159 .Xr libarchive ,
160 this may or may not include self-extracting archives.
161 .Sh SEE ALSO
162 .Xr libarchive 3
163 .Sh HISTORY
164 The
165 .Nm
166 utility appeared in
167 .Fx 8.0 .
168 .Sh AUTHORS
169 The
170 .Nm
171 utility and this manual page were written by
172 .An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
173 It uses the
174 .Xr archive 3
175 library developed by
176 .An Tim Kientzle Aq kientzle@FreeBSD.org .