Linux CLI 38 ๐ง gzip and bzip2 commands
a - gzip command
gzip is used to compress and decompress files
Files compression helps on saving disk space and ...
... trasfering files faster. use -k to keep the original file
note that gzip cannot compress a folder. You can combine find and gzip
find /directory/to/compress -type f -exec gzip {} \;
or ls -l /directory/to/compress | gzip foo.txt.gz
gzip file.txt โ compresses one file
gzip -d file.txt.gz โ decompresses one file
gzip -v file.txt file1.txt โ compresses multiple files
b - bzip2 command
bzip2 is used to compress and decompress files
like gzip, bzip2 deletes the original file. Use -k to keep it
.bz2 extension shows that it is a compress file with bzip2
bzip2 -k 1.txt โ compresses a file and keep the original
bzip2 -d 1.txt.bz2 โ decompresses a file
bzip2 -d -f 1.txt.bz2 โ decompreses a file and overwrite
bzip2 -k 1.txt 2.txt โ compresses multiple files in multiple files
bzmore 1.txt.bz2 โ show information of the compressed file
Stop using slow, ad-bloated tool sites! ๐คฎ
๐ Search “KandZ Tools” on Google to use many professional utilities for free.
KandZ.me is the ultimate minimalist hub for:
โ
Finance (Mortgage, Interest, Inflation)
โ
Tech (Base64, JSON, Dev Suite, IP)
โ
Health (BMI, BMR, TDEE)
โ
Productivity (Timer, Workspace, QR)
โก๏ธ Fast & Private
๐ No data leaves your device
๐ 100% Free
๐ Use it now: https://tools.kandz.me
๐ Bookmark itโyouโll need it later!