Go to main content

man pages section 1: User Commands

Exit Print View

Updated: Wednesday, February 9, 2022

funzip (1)


funzip - filter for extracting from a ZIP archive in a pipe


funzip [-password] [archive[.zip|.gz]]


FUNZIP(1)                   General Commands Manual                  FUNZIP(1)

       funzip - filter for extracting from a ZIP archive in a pipe

       funzip [-password] [archive[.zip|.gz]]

              Optional  password  to  be  used  if  ZIP  archive is encrypted.
              Encryption support can be disabled at build time.  See  DESCRIP-
              TION for more details.

              Optional  input archive file specification.  See DESCRIPTION for

       fUnZip without a file argument acts as a filter; that  is,  it  assumes
       that  a  ZIP archive (or a gzip'd(1) file) is being piped into standard
       input, and it extracts the first (non-directory) member  from  the  ar-
       chive  to  standard  output (stdout).  When standard input (stdin) is a
       terminal (tty) device, fUnZip assumes that this cannot be a  stream  of
       (binary)  compressed  data  and shows a short usage guide, instead.  If
       there is a file argument, then input is read from  the  specified  file
       instead of from stdin.

       A password for encrypted zip files can be specified on the command line
       (preceding the file name, if any) by  prefixing  the  password  with  a
       hyphen.   Note  that  this constitutes a security risk on many systems;
       running processes are often visible via simple  commands  (e.g.,  ps(1)
       under  Unix),  and  command-line  histories  can be read.  If the first
       entry of the zip file is encrypted and no password is specified on  the
       command line, then the user is prompted for a password and the password
       is not echoed on the console.

       Given the limitation on single-member extraction, fUnZip is most useful
       in  conjunction  with a secondary archiver program such as tar(1).  The
       following section includes an example illustrating this  usage  in  the
       case of disk backups to tape.

       Use  fUnZip  to extract the first (non-directory) member of the archive
       "test.zip", and to pipe it into more(1):

           funzip test.zip | more

       Use fUnZip to test the first (non-directory) member of "test.zip" (with
       any error messages sent to standard error (stderr)):

           funzip test.zip > /dev/null

       Use Zip and fUnZip in place of compress(1) and zcat(1) (or gzip(1L) and
       gzcat(1L)) for tape backups:

           tar cf - . | zip -7 | dd of=/dev/nrst0 obs=8k
           dd if=/dev/nrst0 ibs=8k | funzip | tar xf -

       (where, for example, nrst0 is a SCSI tape drive).

       When piping an encrypted file into more and allowing fUnZip  to  prompt
       for  password,  the terminal may sometimes be reset to a non-echo mode.
       This is apparently due to a race condition between  the  two  programs;
       fUnZip  changes  the  terminal  mode  to non-echo before more reads its
       state, and more then "restores" the terminal to this mode before  exit-
       ing.  To recover, run fUnZip on the same file but redirect to /dev/null
       rather than piping into more.  After prompting again for the  password,
       fUnZip should reset the terminal properly.

       There  is no way to extract any member except the first (non-directory)
       from a ZIP archive, but fUnZip will  skip  archive  members  which  are
       directories, and extract the first member which is not a directory.

       Only Deflate compression and Traditional ZIP encryption are supported.

       The  functionality  of  fUnZip should be incorporated into UnZip itself
       (in some future release).

       See attributes(7) for descriptions of the following attributes:

       |Availability   | compress/unzip   |
       |Stability      | Volatile         |

       gzip(1L), unzip(1L), unzipsfx(1L), zip(1L), zipcloak(1L),  zipinfo(1L),
       zipnote(1L), zipsplit(1L)

       The Info-ZIP main Web page is:

       FTP access is available, too:

       Mark Adler (Info-ZIP)

       Source  code  for open source software components in Oracle Solaris can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-

       This     software     was    built    from    source    available    at
       https://github.com/oracle/solaris-userland.   The  original   community
       source     was    downloaded    from     http://antinode.info/ftp/info-

       Further information about this software can be found on the open source
       community website at http://www.info-zip.org/UnZip.html.

Info-ZIP                      06 Nov 2013 (v4.10)                    FUNZIP(1)