# phpman > man > funzip(1)

> **TLDR:** Print the content of the first (non-directory) member in an archive without extraction.
>
- Print the content of the first member in a Zip archive:
  `funzip {{path/to/archive.zip}}`
- Print the content in a `gzip` archive:
  `funzip {{path/to/archive.gz}}`
- Decrypt a Zip or `gzip` archive and print the content:
  `funzip -password {{password}} {{path/to/archive}}`

*Source: tldr-pages*

---

[FUNZIP(1)](https://www.chedong.com/phpMan.php/man/FUNZIP/1/markdown)                              General Commands Manual                             [FUNZIP(1)](https://www.chedong.com/phpMan.php/man/FUNZIP/1/markdown)



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

## SYNOPSIS
       **funzip** [**-password**] [_input[.zip|.gz]_]

## ARGUMENTS
       [_-password_]
              Optional  password to be used if ZIP archive is encrypted.  Decryption may not be sup‐
              ported at some sites.  See DESCRIPTION for more details.

       [_input[.zip|.gz]_]
              Optional input archive file specification. See DESCRIPTION for details.

## DESCRIPTION
       _funzip_ without a file argument acts as a filter; that is, it assumes that a ZIP archive (or a
       _gzip_'[d(1)](https://www.chedong.com/phpMan.php/man/d/1/markdown) file) is being piped into standard input, and it extracts the first member from the
       archive to stdout.  When stdin comes from a tty device, _funzip_ assumes that this cannot be  a
       stream  of (binary) compressed data and shows a short help text, 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 dash.  Note that this constitutes a security
       risk on many systems; currently running processes  are  often  visible  via  simple  commands
       (e.g.,  [_ps_(1)](https://www.chedong.com/phpMan.php/man/ps/1/markdown) 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)](https://www.chedong.com/phpMan.php/man/tar/1/markdown).  The following section includes an example  illus‐
       trating this usage in the case of disk backups to tape.

## EXAMPLES
       To  use  _funzip_  to extract the first member file of the archive test.zip and to pipe it into
       [_more_(1)](https://www.chedong.com/phpMan.php/man/more/1/markdown):

       funzip test.zip | more

       To use _funzip_ to test the first member file of test.zip (any errors will be reported on stan‐
       dard error):

       funzip test.zip > /dev/null

       To  use _zip_ and _funzip_ in place of [_compress_(1)](https://www.chedong.com/phpMan.php/man/compress/1/markdown) and [_zcat_(1)](https://www.chedong.com/phpMan.php/man/zcat/1/markdown) (or [_gzip_(1)](https://www.chedong.com/phpMan.php/man/gzip/1/markdown) and [_gzcat_(1)](https://www.chedong.com/phpMan.php/man/gzcat/1/markdown)) 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).

## BUGS
       When piping an encrypted file into _more_ and allowing _funzip_ to prompt for password, the  ter‐
       minal  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 exiting.  To recover, run
       _funzip_ on the same file but redirect to /dev/null rather than piping into more; after prompt‐
       ing again for the password, _funzip_ will reset the terminal properly.

       There is presently no way to extract any member but the first from a ZIP archive.  This would
       be useful in the case where a ZIP archive is included within another archive.   In  the  case
       where the first member is a directory, _funzip_ simply creates the directory and exits.

       The functionality of _funzip_ should be incorporated into _unzip_ itself (future release).

## SEE ALSO
       [_gzip_(1)](https://www.chedong.com/phpMan.php/man/gzip/1/markdown), [_unzip_(1)](https://www.chedong.com/phpMan.php/man/unzip/1/markdown), [_unzipsfx_(1)](https://www.chedong.com/phpMan.php/man/unzipsfx/1/markdown), [_zip_(1)](https://www.chedong.com/phpMan.php/man/zip/1/markdown), [_zipcloak_(1)](https://www.chedong.com/phpMan.php/man/zipcloak/1/markdown), [_zipinfo_(1)](https://www.chedong.com/phpMan.php/man/zipinfo/1/markdown), [_zipnote_(1)](https://www.chedong.com/phpMan.php/man/zipnote/1/markdown), [_zipsplit_(1)](https://www.chedong.com/phpMan.php/man/zipsplit/1/markdown)

## URL
       The Info-ZIP home page is currently at
       <http://www.info-zip.org/pub/infozip/>
       or
       ftp://ftp.info-zip.org/pub/infozip/ .

## AUTHOR
       Mark Adler (Info-ZIP)



Info-ZIP                                20 April 2009 (v3.95)                              [FUNZIP(1)](https://www.chedong.com/phpMan.php/man/FUNZIP/1/markdown)
