The most detailed Linux compression decompression command

  

Compressed files can save a lot of space for the disk, then what are the compression and decompression commands of the Linux system? The following small series will introduce you to the Linux compression and decompression command Daquan, I hope to help you.

.tar

unpack: tar zxvf FileName.tar

Packing: tar czvf FileName.tar DirName

----- ----------------------------------------

.gz

Extract 1: gunzip FileName.gz

Extract 2:gzip -d FileName.gz

Compress: gzip FileName

.tar.gz and .tgz< Br>

Unzip: tar zxvf FileName.tar.gz

Compression: tar zcvf FileName.tar.gz DirName

-------------- -------------------------------

.bz2

Extract 1:bzip2 - d FileName.bz2

Extract 2: bunzip2 FileName.bz2

Compress: bzip2 -z FileName

.tar.bz2

Extract: tar jxvf FileName .tar.bz2

Compression: tar jcvf FileName.tar.bz2 DirName

------------------------ ---------------------

.bz

Extract 1:bzip2 -d FileName.bz

Unzip 2: bunzip2 FileName.bz

Compression: Unknown

.tar.bz

Unzip: tar jxvf FileName.tar.bz

Compression: Unknown

------------------------- --------------------

.Z

Unpacking: uncompress FileName.Z

Compression: compress FileName

.tar.Z

Unpacking: tar Zxvf FileName.tar.Z

Compression: tar Zcvf FileName.tar.Z DirName

--- ------------------------------------------

.zip

Unzip: unzip FileName.zip

Compress: zip FileName.zip DirName

------------------- --------------------------

.rar

Decompression: rar a FileName.rar

Compression: r ar e FileName.rar

After decompressing, please copy rar_static to the /usr/bin directory (other directories specified by the $PATH environment variable):

[ Root@www2 tmp]# cp rar_static /usr/bin/rar

------------------------------ ---------------

.lha

Unpacking: lha -e FileName.lha

Compression: lh a -a FileName.lha FileName

"Please copy lha to the /usr/bin directory after decompression (other directories specified by the $PATH environment variable are also available):

[root@www2 Tmp]# cp lha /usr/bin/

---------------------------------- -----------

.rpm

Unpacking: rpm2cpio FileName.rpm |  Cpio -div

----------------------------------------- ----

.deb

Unpacking: ar p FileName.deb data.tar.gz |  Tar zxf -

----------------------------------------- ----

The above is the introduction of the Linux compression and decompression command. If you are learning the relevant knowledge, here is the most complete compression and decompression command, which will help you in your study.

Copyright © Windows knowledge All Rights Reserved