Detailed explanation of compression and decompression commands under Linux

Time:2021-2-26

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

.tar.bz2

Decompression: tar – jxvf FileName.tar.bz2

Compression: tar – jcvf FileName.tar.bz2 DirName

[BZ command]

Unzip 1: bzip2 – D FileName.bz

Unzip 2: bunzip2 FileName.bz

Compression: unknown

.tar.bz

Decompression: tar – jxvf FileName.tar.bz

[Z command]

Decompress: uncompress file name. Z

Compression: compress file name

 .tar.Z

Decompression: tar – zxvf FileName.tar .Z

Compression: tar – zcvf FileName.tar .Z DirName

[zip command]

Unzip: unzip FileName.zip

Compression: zip FileName.zip DirName

analysis

[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 […]