CentOS Linux Server Guide

File decompress, extraction using bunzip2 in CentOS Linux

Bunzip2

  • Bunzip2, is the most common command used to extract a bz2 file extension in Linux

Command name

bunzip2

 

Synopsis

bunzip2 filename.bz2

 

Option

-v  show compression rate

-k  keep the original file after compression, do not delete

-d --decompress, force decompression
-z --compress,  force compression

 

 

Note

Upon bzip usefully complete file compression, the original document/file will be removed. Thus, it is always recommend to use option -k 

 

Example
-rw-rw-r-- 1 root utmp 14976 Apr 17 19:22 wtmp.1
-rw-rw-r-- 1 root utmp 631 Apr 17 19:22 wtmp.bz2

bunzip2 -v -k wtmp.bz2

wtmp.bz2: done

ls -l

-rw-rw-r-- 1 root utmp 14976 Apr 17 19:22 wtmp
-rw-rw-r-- 1 root utmp 26880 Mar 8 19:42 wtmp.1
-rw-rw-r-- 1 root utmp 631 Apr 17 19:22 wtmp.bz2

 

 

Back to File Compression and Archiving



Copyright 2011 http://www.1a-centosserver.com All Rights Reserved

All trademarks are the property of their respective owners.

Contact Us | Terms of Use | Privacy Policy