Home  >  Article  >  Operation and Maintenance  >  What are the commands to decompress files in linux?

What are the commands to decompress files in linux?

尚
Original
2020-03-04 10:21:08112372browse

The decompression file commands are: 1. tar, the syntax is "tar xvf compressed file name.tar"; 2. gzip, the syntax is "gunzip compressed file name.gz"; 3. bzip2, the syntax is "bzip2 -d compression File name.bz2"; 4. rar, syntax "rar x compressed file name.rar".

What are the commands to decompress files in linux?

#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.

Linux decompression file command:

1, .tar

Unpacking: tar xvf FileName.tar

Packaging: tar cvf FileName.tar DirName

(Note: tar is packaging, not compression!)

2, .gz

Decompression 1: gunzip FileName.gz

Decompression 2: gzip -d FileName.gz

Compression: gzip FileName

3、.tar.gz and .tgz

Decompression: tar zxvf FileName.tar.gz

Compression: tar zcvf FileName.tar.gz DirName

4, .bz2

Decompression 1: bzip2 -d FileName.bz2

Decompression 2: bunzip2 FileName.bz2

Compression: bzip2 -z FileName

5、.tar.bz2

Decompression: tar jxvf FileName.tar.bz2

Compression: tar jcvf FileName.tar.bz2 DirName

6, .bz

Decompression 1: bzip2 -d FileName.bz

Decompression 2: bunzip2 FileName.bz

Compression: Unknown

7、.tar.bz

Decompression: tar jxvf FileName.tar.bz

Compression: Unknown

8、.Z

Decompression: uncompress FileName.Z

Compression: compress FileName

9、.tar.Z

Decompression: tar Zxvf FileName.tar.Z

Compression: tar Zcvf FileName.tar.Z DirName

10, .zip

Decompression :unzip FileName.zip

Compression: zip FileName.zip DirName

11, .rar

Unzip: rar x FileName.rar

Compression: rar a FileName.rar DirName

12, .lha

Decompression: lha -e FileName.lha

Compression: lha -a FileName.lha FileName

Recommended: Linux self-study video

The above is the detailed content of What are the commands to decompress files in linux?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn