bzip2 common options:
-k (keep) in compression or decompression, retained the input file. -d (decompress) the compressed file is decompressed
1) compression
bzip2 -k source file name
For example: bzip2 -k mypwd.1
get a suffix of .bz2 compressed files
2) unzip
bzip2 -kd compressed file name
such as:bzip2 -kd mypwd.1.bz2
note:
1) If the bzip2 without any options, this time for compression, the compression of the finished file will be generated suffix .bz2 compressed file and delete the original file, so that is recommended bzip2 -k
to compress the source file.
2) bzip2 can compress a single file, directory can not be compressed.
Single file compression using gzip or bzip2
Compression has two parameters:
1) compression time
2) compression ratio
Typically, small files using gzip to compress large files using bzip2 to compress .