2008-01-08 08:00:06 +00:00
|
|
|
|
.\"-
|
|
|
|
|
.\" Copyright (c) 2007-2008 Dag-Erling Co<43>dan Sm<53>rgrav
|
|
|
|
|
.\" All rights reserved.
|
|
|
|
|
.\"
|
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
|
.\" are met:
|
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
|
.\"
|
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
|
.\"
|
|
|
|
|
.\" $FreeBSD$
|
|
|
|
|
.\"
|
2010-10-21 17:23:09 +00:00
|
|
|
|
.Dd October 21, 2010
|
2008-01-08 08:00:06 +00:00
|
|
|
|
.Dt UNZIP 1
|
|
|
|
|
.Os
|
|
|
|
|
.Sh NAME
|
|
|
|
|
.Nm unzip
|
|
|
|
|
.Nd extract files from a ZIP archive
|
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
|
.Nm
|
2009-09-08 15:55:13 +00:00
|
|
|
|
.Op Fl aCcfjLlnopqtuv
|
2008-01-08 08:00:06 +00:00
|
|
|
|
.Op Fl d Ar dir
|
|
|
|
|
.Ar zipfile
|
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
|
.\" ...
|
|
|
|
|
.Pp
|
|
|
|
|
The following options are available:
|
|
|
|
|
.Bl -tag -width Fl
|
|
|
|
|
.It Fl a
|
|
|
|
|
When extracting a text file, convert DOS-style line endings to
|
|
|
|
|
Unix-style line endings.
|
2009-09-08 15:55:13 +00:00
|
|
|
|
.It Fl C
|
|
|
|
|
Match file names case-insensitively.
|
|
|
|
|
.It Fl c
|
|
|
|
|
Extract to stdout/screen.
|
|
|
|
|
When extracting files from the zipfile, they are written to stdout.
|
|
|
|
|
This is similar to
|
|
|
|
|
.Fl p ,
|
|
|
|
|
but doesn't suppress normal output.
|
2008-01-08 08:00:06 +00:00
|
|
|
|
.It Fl d Ar dir
|
|
|
|
|
Extract files into the specified directory rather than the current
|
|
|
|
|
directory.
|
2009-09-08 15:55:13 +00:00
|
|
|
|
.It Fl f
|
|
|
|
|
Update existing.
|
|
|
|
|
Extract only files from the zipfile if a file with the same name
|
|
|
|
|
already exists on disk and is older than the former.
|
|
|
|
|
Otherwise, the file is silently skipped.
|
2008-01-08 08:00:06 +00:00
|
|
|
|
.It Fl j
|
|
|
|
|
Ignore directories stored in the zipfile; instead, extract all files
|
|
|
|
|
directly into the extraction directory.
|
|
|
|
|
.It Fl L
|
|
|
|
|
Convert the names of the extracted files and directories to lowercase.
|
|
|
|
|
.It Fl l
|
|
|
|
|
List, rather than extract, the contents of the zipfile.
|
|
|
|
|
.It Fl n
|
|
|
|
|
No overwrite.
|
2009-09-08 15:55:13 +00:00
|
|
|
|
When extracting a file from the zipfile, if a file with the same name
|
2008-01-08 08:00:06 +00:00
|
|
|
|
already exists on disk, the file is silently skipped.
|
|
|
|
|
.It Fl o
|
|
|
|
|
Overwrite.
|
2009-09-08 15:55:13 +00:00
|
|
|
|
When extracting a file from the zipfile, if a file with the same name
|
2008-01-08 08:00:06 +00:00
|
|
|
|
already exists on disk, the existing file is replaced with the file
|
|
|
|
|
from the zipfile.
|
2009-09-08 15:55:13 +00:00
|
|
|
|
.It Fl p
|
|
|
|
|
Extract to stdout.
|
|
|
|
|
When extracting files from the zipfile, they are written to stdout.
|
|
|
|
|
The normal output is suppressed as if
|
|
|
|
|
.Fl q
|
|
|
|
|
was specified.
|
2008-01-08 08:00:06 +00:00
|
|
|
|
.It Fl q
|
|
|
|
|
Quiet: print less information while extracting.
|
2008-06-30 17:16:05 +00:00
|
|
|
|
.It Fl t
|
|
|
|
|
Test: do not extract anything, but verify the checksum of every file
|
|
|
|
|
in the archive.
|
2008-01-08 08:00:06 +00:00
|
|
|
|
.It Fl u
|
|
|
|
|
Update.
|
2009-09-08 15:55:13 +00:00
|
|
|
|
When extracting a file from the zipfile, if a file with the same name
|
2008-01-08 08:00:06 +00:00
|
|
|
|
already exists on disk, the existing file is replaced with the file
|
|
|
|
|
from the zipfile if and only if the latter is newer than the former.
|
|
|
|
|
Otherwise, the file is silently skipped.
|
2009-09-08 15:55:13 +00:00
|
|
|
|
.It Fl v
|
|
|
|
|
List verbosely, rather than extract, the contents of the zipfile.
|
|
|
|
|
This differs from
|
|
|
|
|
.Fl l
|
|
|
|
|
by using the long listing.
|
|
|
|
|
Note that most of the data is currently fake and does not reflect the
|
|
|
|
|
content of the archive.
|
|
|
|
|
.It Fl x Ar pattern
|
|
|
|
|
Exclude files matching the pattern
|
|
|
|
|
.Ar pattern .
|
2008-01-08 08:00:06 +00:00
|
|
|
|
.El
|
|
|
|
|
.Pp
|
|
|
|
|
Note that only one of
|
|
|
|
|
.Fl n ,
|
2009-09-08 15:55:13 +00:00
|
|
|
|
.Fl o ,
|
2008-01-08 08:00:06 +00:00
|
|
|
|
and
|
|
|
|
|
.Fl u
|
|
|
|
|
may be specified.
|
2010-10-21 20:22:00 +00:00
|
|
|
|
If specified filename is
|
2010-10-21 17:23:09 +00:00
|
|
|
|
.Va Qq - ,
|
|
|
|
|
then data is read from
|
|
|
|
|
.Va stdin .
|
2008-01-08 08:00:06 +00:00
|
|
|
|
.Sh ENVIRONMENT
|
|
|
|
|
If the
|
|
|
|
|
.Ev UNZIP_DEBUG
|
|
|
|
|
environment variable is defined, the
|
|
|
|
|
.Fl q
|
|
|
|
|
command-line option has no effect, and additional debugging
|
|
|
|
|
information will be printed to
|
|
|
|
|
.Va stderr .
|
|
|
|
|
.Sh COMPATIBILITY
|
|
|
|
|
The
|
|
|
|
|
.Nm
|
|
|
|
|
utility aims to be sufficiently compatible with other implementations
|
|
|
|
|
to serve as a drop-in replacement in the context of the
|
|
|
|
|
.Xr ports 7
|
|
|
|
|
system.
|
|
|
|
|
No attempt has been made to replicate functionality which is not
|
|
|
|
|
required for that purpose.
|
|
|
|
|
.Pp
|
|
|
|
|
For compatibility reasons, command-line options will be recognized if
|
|
|
|
|
they are listed not only before but also after the name of the
|
|
|
|
|
zipfile.
|
|
|
|
|
.Pp
|
|
|
|
|
Normally, the
|
|
|
|
|
.Fl a
|
|
|
|
|
option should only affect files which are marked as text files in the
|
|
|
|
|
zipfile's central directory.
|
|
|
|
|
Since the
|
|
|
|
|
.Xr archive 3
|
|
|
|
|
library reads zipfiles sequentially, and does not use the central
|
|
|
|
|
directory, that information is not available to the
|
|
|
|
|
.Nm
|
|
|
|
|
utility.
|
|
|
|
|
Instead, the
|
|
|
|
|
.Nm
|
|
|
|
|
utility will assume that a file is a text file if no non-ASCII
|
|
|
|
|
characters are present within the first block of data decompressed for
|
|
|
|
|
that file.
|
|
|
|
|
If non-ASCII characters appear in subsequent blocks of data, a warning
|
|
|
|
|
will be issued.
|
|
|
|
|
.Pp
|
|
|
|
|
The
|
|
|
|
|
.Nm
|
|
|
|
|
utility is only able to process ZIP archives handled by
|
|
|
|
|
.Xr libarchive 3 .
|
|
|
|
|
Depending on the installed version of
|
|
|
|
|
.Xr libarchive ,
|
|
|
|
|
this may or may not include self-extracting archives.
|
|
|
|
|
.Sh SEE ALSO
|
|
|
|
|
.Xr libarchive 3
|
|
|
|
|
.Sh HISTORY
|
|
|
|
|
The
|
|
|
|
|
.Nm
|
|
|
|
|
utility appeared in
|
|
|
|
|
.Fx 8.0 .
|
|
|
|
|
.Sh AUTHORS
|
|
|
|
|
The
|
|
|
|
|
.Nm
|
|
|
|
|
utility and this manual page were written by
|
|
|
|
|
.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org .
|
|
|
|
|
It uses the
|
|
|
|
|
.Xr archive 3
|
|
|
|
|
library developed by
|
|
|
|
|
.An Tim Kientzle Aq kientzle@FreeBSD.org .
|