File compressors. Both compressors are similar. bzip2 has higher compression rate, but gzip is more popular/well-known.
e.g.
gzip -9 <FILE> bzip2 -9 <FILE>
The compressed file will have .gz and .bz2 for gzip and bzip2 respectively. The parameter "-9" means compression ratio. It ranges from 1 to 9. with 1 the fastest but the lowest compression rate and 9 the slowest but the highest compression rate. The original file <FILE> will be removed.
gunzip <FILE> bunzip2 <FILE>
After decompression, the compressed file will be removed.
How:
Go to ~/gzip:
cd ~/gzip
gzip ./bigfile_g1
gzip -9 ./bigfile_g9
bzip2 ./bigfile_b1
bzip2 -9 ./bigfile_b9
Note their filenames and compare their file sizes:
ls -l
[yuni@lovely-linux gzip]\$ ls -l total 369 drwx------ 2 yuni yuni 512 Jul 15 20:36 ./ drwx--x--x 258 yuni yuni 24576 Jul 15 20:08 ../ -rw------- 1 yuni yuni 86013 Jul 15 20:36 bigfile_b1.bz2 -rw------- 1 yuni yuni 83283 Jul 15 20:36 bigfile_b9.bz2 -rw------- 1 yuni yuni 90380 Jul 15 20:36 bigfile_g1.gz -rw------- 1 yuni yuni 90095 Jul 15 20:36 bigfile_g9.gz
gunzip bigfile_g1.gz
bunzip2 bigfile_b9.bz2