140b23ce4SThomas Cort.\"- 240b23ce4SThomas Cort.\" Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org> 340b23ce4SThomas Cort.\" Copyright (c) 2007-2008 Dag-Erling Co�dan Sm�rgrav 440b23ce4SThomas Cort.\" All rights reserved. 540b23ce4SThomas Cort.\" 640b23ce4SThomas Cort.\" Redistribution and use in source and binary forms, with or without 740b23ce4SThomas Cort.\" modification, are permitted provided that the following conditions 840b23ce4SThomas Cort.\" are met: 940b23ce4SThomas Cort.\" 1. Redistributions of source code must retain the above copyright 1040b23ce4SThomas Cort.\" notice, this list of conditions and the following disclaimer. 1140b23ce4SThomas Cort.\" 2. Redistributions in binary form must reproduce the above copyright 1240b23ce4SThomas Cort.\" notice, this list of conditions and the following disclaimer in the 1340b23ce4SThomas Cort.\" documentation and/or other materials provided with the distribution. 1440b23ce4SThomas Cort.\" 1540b23ce4SThomas Cort.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1640b23ce4SThomas Cort.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1740b23ce4SThomas Cort.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1840b23ce4SThomas Cort.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1940b23ce4SThomas Cort.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2040b23ce4SThomas Cort.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2140b23ce4SThomas Cort.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2240b23ce4SThomas Cort.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2340b23ce4SThomas Cort.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2440b23ce4SThomas Cort.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2540b23ce4SThomas Cort.\" SUCH DAMAGE. 2640b23ce4SThomas Cort.\" 2740b23ce4SThomas Cort.\" $FreeBSD: revision 180125$ 28*0a6a1f1dSLionel Sambuc.\" $NetBSD: unzip.1,v 1.10 2014/03/18 18:20:45 riastradh Exp $ 2940b23ce4SThomas Cort.\" 3040b23ce4SThomas Cort.Dd August 18, 2011 3140b23ce4SThomas Cort.Dt UNZIP 1 3240b23ce4SThomas Cort.Os 3340b23ce4SThomas Cort.Sh NAME 3440b23ce4SThomas Cort.Nm unzip 3540b23ce4SThomas Cort.Nd extract files from a ZIP archive 3640b23ce4SThomas Cort.Sh SYNOPSIS 3740b23ce4SThomas Cort.Nm 3840b23ce4SThomas Cort.Op Fl aCcfjLlnopqtuvy 3940b23ce4SThomas Cort.Op Fl d Ar dir 4040b23ce4SThomas Cort.Op Fl x Ar pattern 4140b23ce4SThomas Cort.Ar zipfile 4240b23ce4SThomas Cort.Sh DESCRIPTION 4340b23ce4SThomas CortThe following options are available: 4440b23ce4SThomas Cort.Bl -tag -width Fl 4540b23ce4SThomas Cort.It Fl a 4640b23ce4SThomas CortWhen extracting a text file, convert DOS-style line endings to 4740b23ce4SThomas CortUnix-style line endings. 4840b23ce4SThomas Cort.It Fl C 4940b23ce4SThomas CortMatch file names case-insensitively. 5040b23ce4SThomas Cort.It Fl c 5140b23ce4SThomas CortExtract to stdout/screen. 5240b23ce4SThomas CortWhen extracting files from the zipfile, they are written to stdout. 5340b23ce4SThomas CortThis is similar to 5440b23ce4SThomas Cort.Fl p , 5540b23ce4SThomas Cortbut doesn't suppress normal output. 5640b23ce4SThomas Cort.It Fl d Ar dir 5740b23ce4SThomas CortExtract files into the specified directory rather than the current 5840b23ce4SThomas Cortdirectory. 5940b23ce4SThomas Cort.It Fl f 6040b23ce4SThomas CortUpdate existing. 6140b23ce4SThomas CortExtract only files from the zipfile if a file with the same name 6240b23ce4SThomas Cortalready exists on disk and is older than the former. 6340b23ce4SThomas CortOtherwise, the file is silently skipped. 6440b23ce4SThomas Cort.It Fl j 6540b23ce4SThomas CortIgnore directories stored in the zipfile; instead, extract all files 6640b23ce4SThomas Cortdirectly into the extraction directory. 6740b23ce4SThomas Cort.It Fl L 6840b23ce4SThomas CortConvert the names of the extracted files and directories to lowercase. 6940b23ce4SThomas Cort.It Fl l 7040b23ce4SThomas CortList, rather than extract, the contents of the zipfile. 7140b23ce4SThomas Cort.It Fl n 7240b23ce4SThomas CortNo overwrite. 7340b23ce4SThomas CortWhen extracting a file from the zipfile, if a file with the same name 7440b23ce4SThomas Cortalready exists on disk, the file is silently skipped. 7540b23ce4SThomas Cort.It Fl o 7640b23ce4SThomas CortOverwrite. 7740b23ce4SThomas CortWhen extracting a file from the zipfile, if a file with the same name 7840b23ce4SThomas Cortalready exists on disk, the existing file is replaced with the file 7940b23ce4SThomas Cortfrom the zipfile. 8040b23ce4SThomas Cort.It Fl p 8140b23ce4SThomas CortExtract to stdout. 8240b23ce4SThomas CortWhen extracting files from the zipfile, they are written to stdout. 8340b23ce4SThomas CortThe normal output is suppressed as if 8440b23ce4SThomas Cort.Fl q 8540b23ce4SThomas Cortwas specified. 8640b23ce4SThomas Cort.It Fl q 8740b23ce4SThomas CortQuiet: print less information while extracting. 8840b23ce4SThomas Cort.It Fl t 8940b23ce4SThomas CortTest: do not extract anything, but verify the checksum of every file 9040b23ce4SThomas Cortin the archive. 9140b23ce4SThomas Cort.It Fl u 9240b23ce4SThomas CortUpdate. 9340b23ce4SThomas CortWhen extracting a file from the zipfile, if a file with the same name 9440b23ce4SThomas Cortalready exists on disk, the existing file is replaced with the file 9540b23ce4SThomas Cortfrom the zipfile if and only if the latter is newer than the former. 9640b23ce4SThomas CortOtherwise, the file is silently skipped. 9740b23ce4SThomas Cort.It Fl v 9840b23ce4SThomas CortList verbosely, rather than extract, the contents of the zipfile. 9940b23ce4SThomas CortThis differs from 10040b23ce4SThomas Cort.Fl l 10140b23ce4SThomas Cortby using the long listing. 10240b23ce4SThomas CortNote that most of the data is currently fake and does not reflect the 10340b23ce4SThomas Cortcontent of the archive. 10440b23ce4SThomas Cort.It Fl x Ar pattern 10540b23ce4SThomas CortExclude files matching the pattern 10640b23ce4SThomas Cort.Ar pattern . 10740b23ce4SThomas Cort.It Fl y 10840b23ce4SThomas CortPrint four digit years in listings instead of two. 10940b23ce4SThomas Cort.El 11040b23ce4SThomas Cort.Pp 11140b23ce4SThomas CortNote that only one of 11240b23ce4SThomas Cort.Fl n , 11340b23ce4SThomas Cort.Fl o , 11440b23ce4SThomas Cortand 11540b23ce4SThomas Cort.Fl u 11640b23ce4SThomas Cortmay be specified. 11740b23ce4SThomas Cort.Sh ENVIRONMENT 11840b23ce4SThomas CortIf the 11940b23ce4SThomas Cort.Ev UNZIP_DEBUG 12040b23ce4SThomas Cortenvironment variable is defined, the 12140b23ce4SThomas Cort.Fl q 12240b23ce4SThomas Cortcommand-line option has no effect, and additional debugging 12340b23ce4SThomas Cortinformation will be printed to 12440b23ce4SThomas Cort.Va stderr . 12540b23ce4SThomas Cort.Sh COMPATIBILITY 12640b23ce4SThomas CortThe 12740b23ce4SThomas Cort.Nm 12840b23ce4SThomas Cortutility aims to be sufficiently compatible with other implementations 12940b23ce4SThomas Cortto serve as a drop-in replacement in the context of the 13040b23ce4SThomas Cort.Xr pkgsrc 7 13140b23ce4SThomas Cortsystem. 13240b23ce4SThomas CortNo attempt has been made to replicate functionality which is not 13340b23ce4SThomas Cortrequired for that purpose. 13440b23ce4SThomas Cort.Pp 13540b23ce4SThomas CortFor compatibility reasons, command-line options will be recognized if 13640b23ce4SThomas Cortthey are listed not only before but also after the name of the 13740b23ce4SThomas Cortzipfile. 13840b23ce4SThomas Cort.Pp 13940b23ce4SThomas CortNormally, the 14040b23ce4SThomas Cort.Fl a 14140b23ce4SThomas Cortoption should only affect files which are marked as text files in the 14240b23ce4SThomas Cortzipfile's central directory. 14340b23ce4SThomas CortSince the 14440b23ce4SThomas Cort.Xr archive 3 14540b23ce4SThomas Cortlibrary reads zipfiles sequentially, and does not use the central 14640b23ce4SThomas Cortdirectory, that information is not available to the 14740b23ce4SThomas Cort.Nm 14840b23ce4SThomas Cortutility. 14940b23ce4SThomas CortInstead, the 15040b23ce4SThomas Cort.Nm 15140b23ce4SThomas Cortutility will assume that a file is a text file if no non-ASCII 15240b23ce4SThomas Cortcharacters are present within the first block of data decompressed for 15340b23ce4SThomas Cortthat file. 15440b23ce4SThomas CortIf non-ASCII characters appear in subsequent blocks of data, a warning 15540b23ce4SThomas Cortwill be issued. 15640b23ce4SThomas Cort.Pp 15740b23ce4SThomas CortThe 15840b23ce4SThomas Cort.Nm 15940b23ce4SThomas Cortutility is only able to process ZIP archives handled by 16040b23ce4SThomas Cort.Xr libarchive 3 . 16140b23ce4SThomas CortDepending on the installed version of 16240b23ce4SThomas Cort.Xr libarchive 3 , 16340b23ce4SThomas Cortthis may or may not include self-extracting archives. 16440b23ce4SThomas Cort.Sh SEE ALSO 16540b23ce4SThomas Cort.Xr libarchive 3 16640b23ce4SThomas Cort.Sh HISTORY 16740b23ce4SThomas CortThe 16840b23ce4SThomas Cort.Nm 16940b23ce4SThomas Cortutility appeared in 17040b23ce4SThomas Cort.Nx 6.0 . 17140b23ce4SThomas Cort.Sh AUTHORS 17240b23ce4SThomas CortThe 17340b23ce4SThomas Cort.Nm 17440b23ce4SThomas Cortutility and this manual page were written by 17540b23ce4SThomas Cort.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org . 17640b23ce4SThomas CortIt uses the 17740b23ce4SThomas Cort.Xr archive 3 17840b23ce4SThomas Cortlibrary developed by 17940b23ce4SThomas Cort.An Tim Kientzle Aq Mt kientzle@FreeBSD.org . 18040b23ce4SThomas Cort.Sh BUGS 18140b23ce4SThomas CortThe 18240b23ce4SThomas Cort.Nm 18340b23ce4SThomas Cortutility currently does not support asking the user whether to 18440b23ce4SThomas Cortoverwrite or skip a file that already exists on disk. 18540b23ce4SThomas CortTo be on the safe side, it will fail if it encounters a file that 18640b23ce4SThomas Cortalready exists and neither the 18740b23ce4SThomas Cort.Fl n 18840b23ce4SThomas Cortnor the 18940b23ce4SThomas Cort.Fl o 19040b23ce4SThomas Cortcommand line option was specified. 191