.gz
有没有办法在不解压的情况下检查压缩数据集( )的正常大小?
例如,我有 50 个大.gz
文件(总共 50 GB),由于存储问题而无法解压缩,但我想报告其中有多少正常数据。
答案1
使用该-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
即使该选项不可用,您仍然不需要任何存储空间来解压缩文件并测量其大小:
gzip -cd file.gz | wc -c