
.gz
압축을 풀지 않고 압축된 데이터세트( )의 일반 크기를 확인할 수 있는 방법이 있나요 ?
예를 들어 스토리지 문제로 인해 압축을 풀 수 없는 50개의 대용량 파일(총 50Gb)이 있는데 .gz
거기에 얼마나 많은 일반 데이터가 있는지 보고하고 싶습니다.
답변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