LinuxCommandLibrary

funzip

Extract compressed files with the .zip suffix

TLDR

Print the content of the first member in a Zip archive

$ funzip [path/to/archive.zip]
copy

Print the content in a gzip archive
$ funzip [path/to/archive.gz]
copy

Decrypt a Zip or gzip archive and print the content
$ funzip -password [password] [path/to/archive]
copy

SYNOPSIS

funzip [-c] [zipfile.zip]

PARAMETERS

-c
    Print only the ZIP archive comment to stdout

DESCRIPTION

Funzip is a lightweight filter utility from the unzip package, designed to extract the first (lowest header number) member from a ZIP archive directly to stdout. It excels in pipeline scenarios, reading archives from stdin by default or a named file if specified. Unlike unzip, it ignores additional members and requires no filename arguments, making it ideal for quick previews, scripting, or processing streamed ZIP data.

Funzip transparently handles self-extracting (.exe) stubs by skipping them. If the target member is encrypted, it prompts for a password interactively. It supports ZIP64 extensions for large files but focuses solely on the initial entry, outputting raw data without decompression metadata. Use the -c option to retrieve only the archive comment instead.

This simplicity suits embedded use cases, remote file handling, or when full extraction is unnecessary, conserving resources on minimal systems.

CAVEATS

Extracts only the first member; ignores directories and rest.
Password prompt may fail in non-interactive environments.
Not for multi-member selection or listing.

ENCRYPTION HANDLING

If first member encrypted, prompts for password; supports traditional ZIP encryption.

EXAMPLES

cat remote.zip | funzip > firstfile (from pipe)
funzip archive.zip (from file)
funzip -c archive.zip (print comment)

HISTORY

Part of the open-source Info-ZIP project since 1991; introduced in unzip 5.1 (1998) for pipe-friendly extraction. Maintained across POSIX systems, with ZIP64 support added in unzip 6.0 (2007).

SEE ALSO

unzip(1), zip(1), zipinfo(1), unzipsfx(1)

Copied to clipboard