Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Sorting out decompression commands under linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "decompression command arrangement under linux". In daily operation, I believe many people have doubts about decompression command arrangement under linux. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "decompression command arrangement under linux". Next, please follow the editor to study!

.tar

Unpack: tar xvf FileName.tar

Packaging: tar cvf FileName.tar DirName

(note: tar is packaging, not compression! )

-

.gz

Decompress 1:gunzip FileName.gz

Decompress 2:gzip-d FileName.gz

Compression: gzip FileName

.tar.gz and .tgz

Decompress: tar zxvf FileName.tar.gz

Compression: tar zcvf FileName.tar.gz DirName

-

.bz2

Decompress 1:bzip2-d FileName.bz2

Decompress 2:bunzip2 FileName.bz2

Compression: bzip2-z FileName

.tar.bz2

Decompress: tar jxvf FileName.tar.bz2

Compression: tar jcvf FileName.tar.bz2 DirName

-

.bz

Decompress 1:bzip2-d FileName.bz

Decompress 2:bunzip2 FileName.bz

Compression: unknown

.tar.bz

Decompress: tar jxvf FileName.tar.bz

Compression: unknown

-

.Z

Decompress: uncompress FileName.Z

Compression: compress FileName

.tar.Z

Decompress: tar Zxvf FileName.tar.Z

Compression: tar Zcvf FileName.tar.Z DirName

-

.zip

Decompress: unzip FileName.zip

Compression: zip FileName.zip DirName

-

.rar

Decompress: rar x FileName.rar

Compression: rar a FileName.rar DirName

-

.lha

Decompress: lha-e FileName.lha

Compression: lha-a FileName.lha FileName

-

.rpm

Unpack: rpm2cpio FileName.rpm | cpio-div

-

.deb

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

-

.tar .tgz .tar.gz .tar.Z .tar.bz .tar.bz2 .zip .cpio .rpm .deb .slp .arj .rar .ace .lha .lzh .lzx .lzs .arc .sda .sfx .lnx .zoo .cab .kar .cpt .pit .sit .sea

Decompress: sEx x FileName.*

Compression: sEx a FileName.* FileName

SEx only calls the relevant procedures, there is no compression, decompression function, please pay attention!

Gzip command

Reducing file size has two obvious benefits: one is that you can reduce storage space, and the other is that you can reduce the transfer time when transferring files over the network. Gzip is a command that is often used in Linux system to compress and decompress files, which is convenient and easy to use.

Syntax: gzip [options] compress (decompress) the file name of this command the meaning of each option is as follows:

-c writes the output to standard output and keeps the original file. -d decompress the compressed file. -l for each compressed file, the following fields are displayed: the size of the compressed file; the size of the uncompressed file; the compression ratio; the name of the uncompressed file-r recursively finds the specified directory and compresses all files or decompresses it. -t test to check whether the compressed file is complete. -v displays the file name and compression ratio for each compressed and unzipped file. -num adjusts the speed of compression with the specified numeric num,-1 or-fast represents the fastest compression method (low compression ratio), and-9 or-- best represents the slowest compression method (high compression ratio). The system default is 6. Instruction example:

Gzip *% compresses every file in the current directory into a .gz file. Gzip-dv *% unzips each compressed file in the current directory and lists the detailed information. Gzip-l *% shows in detail the information of each compressed file in example 1 and does not extract it. Gzip usr.tar% compresses the tar backup file usr.tar, which now has the .tar.gz extension.

At this point, the study of "decompression command arrangement under linux" is over. I hope to be able to solve everyone's doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report