CentOS Linux Server Guide


File compress using bzip command in CentOS Linux

Bzip2

  • Bzip2, another compression command beside gzip

  • File compressed under bzip, will have .bz2  extension.

Command name

bzip2

 

Synopsis

bzip2  filename

 

Option

-v  show compression rate

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

 

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
-rw-rw-r-- 1 root utmp 26880 Mar 8 19:42 wtmp.1

bzip2 -k file1

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


Creative Commons License
CentOS Server Guide by http://www.1a-centosserver.com is licensed under  Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. All trademarks are the property of their respective owners.

 

Contact Us  | Privacy Policy