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!