Detailed explanation of compression and decompression commands under Linux


In this paper, we share the Linux compression and decompression command, for your reference, the specific content is as follows

[tar command]

Decompression: tar – zxvf FileName.tar

Compression: tar – czvf FileName.tar DirName

[GZ command]

Unzip 1: gunzip FileName.gz

Unzip 2: gzip – D FileName.gz

Compression: gzip file name

. tar.gz And. Tgz

Decompression: tar – zxvf FileName.tar.gz

Compression: tar – zcvf FileName.tar.gz DirName

Compress multiple files: tar – zcvf FileName.tar.gz DirName1 DirName2 DirName3 …

[bz2 command]

Unzip 1: bzip2 – D FileName.bz2

Unzip 2: bunzip2 FileName.bz2

Compression: bzip2 – Z file name


Decompression: tar – jxvf FileName.tar.bz2

Compression: tar – jcvf FileName.tar.bz2 DirName

[BZ command]

Unzip 1: bzip2 – D

Unzip 2: bunzip2

Compression: unknown

Decompression: tar – jxvf

[Z command]

Decompress: uncompress file name. Z

Compression: compress file name


Decompression: tar – zxvf FileName.tar .Z

Compression: tar – zcvf FileName.tar .Z DirName

[zip command]

Unzip: unzip

Compression: zip DirName


[five independent orders]

Compression and decompression all need to use one of them. It can be used with other commands, but only one of them can be used.

-c: Establish compressed files
-x: Decompression
-t: View content
-r: Appending files to the end of a compressed archive
-u: Update the files in the original package

[5 optional parameters]

Optional when compressing or decompressing files as needed.

-z: With gzip attribute
-j: With bz2 attribute
-Z: With compress attribute
-v: Show all processes
-O: Unpack the file to standard output

[1 required parameter]

-f: When using the file name, remember that this parameter is the last parameter, and only the file name can be followed.

The above is the whole content of this article, I hope to help you learn, and I hope you can support developer more.

Recommended Today

Rust and python: why rust can replace Python

In this guide, we compare the rust and python programming languages. We will discuss the applicable use cases in each case, review the advantages and disadvantages of using rust and python, and explain why rust might replace python. I will introduce the following: What is rust? What is Python? When to use rust When to […]