Session and utilities
The bzip2 command
Compresses files with the bzip2 algorithm (.bz2), which usually packs more than gzip at the cost of speed.
Syntax
bzip2 [-d] [-k] archivoMost useful options
-dDecompresses-kKeeps the original-9Maximum compressionCopy-ready examples
$ printf 'texto\n' > f.txt && bzip2 -k f.txt && lsCompress with bzip2You can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- It is slower than gzip and less used today; for general use, gzip or xz.
FAQ
bzip2 or gzip?
bzip2 compresses more but takes longer; gzip is faster and standard.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course