*.tar.gz file decompression command under Linux multiple compression formats

 

1. Compression command:

  Command format: tar -zcvf compressed file name.tar.gz compressed file name

      You can switch to the current directory first. Both the compressed file name and the compressed file name can be added to the path.

 

2. Unzip command:

  Command format: tar -zxvf compressed filename.tar.gz

  The unzipped files can only be placed in the current directory.

01-.tar format
解包:[*******]$ tar xvf FileName.tar
Package: [*******]$ tar cvf FileName.tar DirName (Note: tar is packaged, not compressed!)

02-.gz format
Unzip 1: [*******]$ gunzip FileName.gz
Unzip 2: [*******]$ gzip -d FileName.gz
Compression: [*******]$ gzip FileName

03-.tar.gz format
Unzip: [*******]$ tar zxvf FileName.tar.gz
压缩:[*******]$ tar zcvf FileName.tar.gz DirName

04-.bz2 format
Unzip 1: [*******]$ bzip2 -d FileName.bz2
Unzip 2: [*******]$ bunzip2 FileName.bz2
Compression: [*******]$ bzip2 -z FileName

05-.tar.bz2 format
Unzip: [*******]$ tar jxvf FileName.tar.bz2
压缩:[*******]$ tar jcvf FileName.tar.bz2 DirName

06-.bz format
Unzip 1: [*******]$ bzip2 -d FileName.bz
Unzip 2: [*******]$ bunzip2 FileName.bz

07-.tar.bz format
Unzip: [*******]$ tar jxvf FileName.tar.bz

08-.Z format
Uncompress: [*******]$ uncompress FileName.Z
Compress: [*******]$ compress FileName

09-.tar.Z format
Unzip: [*******]$ tar Zxvf FileName.tar.Z
压缩:[*******]$ tar Zcvf FileName.tar.Z DirName

10-.tgz format
Unzip: [*******]$ tar zxvf FileName.tgz

11-.tar.tgz format
Unzip: [*******]$ tar zxvf FileName.tar.tgz
Compression: [*******]$ tar zcvf FileName.tar.tgz FileName

12-.zip format
Unzip: [*******]$ unzip FileName.zip
Compress: [*******]$ zip FileName.zip DirName

13-.lha format
Unzip: [*******]$ lha -e FileName.lha
压缩:[*******]$ lha -a FileName.lha FileName

14-.rar format
Unzip: [*******]$ rar a FileName.rar
Compression: [*******]$ rar e FileName.rar     
After decompression, please copy rar_static to the /usr/bin directory (others are determined by the $PATH environment variable
The specified directory is also OK): [*******]$ cp rar_static /usr/bin/rar

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326433570&siteId=291194637