gzip 确实有一个 -l 选项:
-l --list
For each compressed file, list the following fields:
compressed size: size of the compressed file
uncompressed size: size of the uncompressed file
ratio: compression ratio (0.0% if unknown)
uncompressed_name: name of the uncompressed file
The uncompressed size is given as -1 for files not in gzip format, such as compressed .Z files. To
get the uncompressed size for such a file, you can use:
zcat file.Z | wc -c
In combination with the --verbose option, the following fields are also displayed:
method: compression method
crc: the 32-bit CRC of the uncompressed data
date & time: time stamp for the uncompressed file
The compression methods currently supported are deflate, compress, lzh (SCO compress -H) and pack.
The crc is given as ffffffff for a file not in gzip format.
With --name, the uncompressed name, date and time are those stored within the compress file if
present.
With --verbose, the size totals and compression ratio for all files is also displayed, unless some
sizes are unknown. With --quiet, the title and totals lines are not displayed.