Overview
zipinfo analyzes the metadata of ZIP files to show what files are inside the archive, each file's compression method, original size, compressed size, modification date, and permissions. This allows you to understand the contents of a ZIP file without opening it.
Key Features
- View the list of files within a ZIP archive
- Display compression ratio, original/compressed size for each file
- Provide modification date and time information for files
- Show Unix permissions and owner information (if supported)
- Check archive comments
Key Options
The zipinfo command allows you to control the output format and filter specific information through various options.
Output Format Control
Information Detail and Filtering
Generated command:
Try combining the commands.
Description:
`zipinfo` Executes the command.
Combine the above options to virtually execute commands with AI.
Usage Examples
Various examples of how to use the zipinfo command.
View Basic Information
zipinfo myarchive.zip
Displays the basic information of the specified ZIP file.
View Summary Information
zipinfo -s myarchive.zip
Checks only the summary information of the ZIP file, such as the total number of files and compressed/original sizes.
View in Unix ls -l Format
zipinfo -m myarchive.zip
Displays information in a format similar to Unix `ls -l`, including file permissions, owner, and group.
Check Information for a Specific File
zipinfo myarchive.zip 'path/to/specific_file.txt'
Filters and displays information only for a specific file within the ZIP archive.
View Archive Comment
zipinfo -z myarchive.zip
Checks the comment stored in the ZIP file.
Installation
In most Linux distributions, `zipinfo` is provided as part of the `unzip` package. If it's not installed by default, you can install it using the following commands.
Debian/Ubuntu
sudo apt update
sudo apt install unzip
Install using the `apt` package manager.
CentOS/RHEL/Fedora
sudo yum install unzip
Install using the `yum` or `dnf` package manager.
Arch Linux
sudo pacman -S unzip
Install using the `pacman` package manager.
Tips & Notes
Useful tips and points to note when using zipinfo.
Useful Tips
- `zipinfo` does not actually extract the contents of a ZIP file, making it very efficient for quickly previewing large ZIP files.
- You can pipe the output to other commands like `grep` or `awk` to search for specific files or patterns. Example: `zipinfo myarchive.zip | grep '.log$'`
- For encrypted ZIP files, `zipinfo` may show the file list, but some information like file size or compression ratio might be inaccurate or not displayed.
Notes
- `zipinfo` does not check the integrity of the ZIP file. To verify if a file is corrupted, you should use commands like `unzip -t` or `zip -T`.
- If the ZIP archive is very large or contains many files, the output of `zipinfo` can be extensive. It's recommended to use it with `less` or `more`. Example: `zipinfo large_archive.zip | less`