LinuxCommandLibrary

zipinfo

List information about ZIP archive files

TLDR

List all files in a Zip file in long format (permissions, ownership, size, and modification date)

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

List all files in a Zip file
$ zipinfo -1 [path/to/archive.zip]
copy

SYNOPSIS

zipinfo [-12cmlvhMtTz] [-{tx|ex}] [zipfile [file ...]]

PARAMETERS

-1
    List just the names of the files, one per line.

-2
    List just the names of the files, one per line, with LF/CRLF indications. Useful for DOS.

-c
    Display a short comment at the top of the listing.

-m
    List in machine-readable format. Useful for scripting.

-l
    List file names and sizes.

-v
    List verbose information.

-h
    Display the help message.

-M
    More verbose version of -v, intended for technical users.

-t
    List the ZIP archive’s entries by last-modified date and time.

-T
    Display date in `YYYY-MM-DD hh:mm:ss' format.

-z
    Display the archive comment.

-tx
    List names found in specified only

-ex
    Exclude names found in specified from listing

zipfile
    The name of the ZIP archive to inspect.

file ...
    Optional list of files within the zip archive to inspect specifically.

DESCRIPTION

The zipinfo command is a utility for listing detailed information about ZIP archive files. It displays a table of contents for the ZIP archive, along with file attributes such as size, compression method, modification date and time, and internal and external attributes. It can be used to verify the integrity of a ZIP file, extract a list of files in the archive, or determine the compression ratio achieved. It offers various options to filter the information displayed, such as listing only hidden files, verbose output, or outputting the information in a machine-readable format for scripting. Zipinfo is commonly used for inspecting ZIP archives before extracting them to ensure they contain the expected files and to check their integrity. It is a crucial tool for managing and working with ZIP archives on Unix-like operating systems.

CAVEATS

Zipinfo might not handle all archive formats or extremely large ZIP files perfectly, especially with older versions. Behavior might differ slightly across platforms.

RETURN CODES

0: Normal exit.
1: Environmental problem (e.g., zipinfo called with bogus options).
2: One or more files were not found.
3: Internal error (e.g., malloc failure).
9: ZIP file is not valid.

HISTORY

zipinfo has been a standard utility in Unix-like systems for a long time, evolving along with the ZIP archive format. It's often bundled with zip and unzip tools, providing essential archive inspection capabilities. Early implementations focused on basic listing and size information, while later versions added verbose output and scripting capabilities.

SEE ALSO

zip(1), unzip(1), jar(1)

Copied to clipboard