Decompression commands under mac

tar
unpacking: tar xvf FileName.tar
packing: tar cvf FileName.tar DirName
(Note: tar is packing, not compression!)
———————————————
.gz
decompression 1: gunzip FileName .gz
decompression 2: gzip -d FileName.gz
compression: gzip FileName

.tar.gz and .tgz
decompress: tar zxvf FileName.tar.gz
Compress: tar zcvf FileName.tar.gz DirName
———————————————
.bz2
decompress 1: bzip2 -d FileName .bz2
decompress 2: bunzip2 FileName.bz2
compress: bzip2 -z FileName

.tar.bz2
decompression: tar jxvf FileName.tar.bz2
compression: tar jcvf FileName.tar.bz2 DirName
———————————————
.bz
decompression 1: bzip2 -d FileName.bz
decompression 2: bunzip2 FileName.bz
compression: unknown

.tar.bz
decompress: tar jxvf FileName.tar.bz
compress: unknown
———————————————
.Z
decompress: uncompress FileName.Z
compress: compress FileName
.tar.Z

Unzip: tar Zxvf FileName.tar.Z
Compress: tar Zcvf FileName.tar.Z DirName
———————————————
.zip
Unzip: unzip FileName.zip
Compress: zip FileName.zip DirName
— ——————————————
.rar
decompression: rar x FileName.rar
compression: rar a FileName.rar DirName
——————————————
.lha
decompression: lha -e FileName.lha
Compress: 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
解压:sEx x FileName.*
压缩:sEx a FileName.* FileName

sEx just calls related programs, it has no compression and decompression functions, please pay attention!


There are two obvious benefits of reducing the file size of the gzip command , one is that it can reduce the storage space, and the other is that when transferring files over a network, it can reduce the transfer time. gzip is a command that is often used in Linux systems to compress and decompress files, which is convenient and easy to use.

Syntax: gzip [options] Compressed (decompressed) filenames The meanings of the options of this command are as follows:

-c Write output to standard output and keep the original file. -d Decompress the compressed file. -l For each compressed file, display the following fields: size of compressed file; size of uncompressed file; compression ratio; name of uncompressed file -r recursively find the specified directory and compress or decompress all files in it. -t Test to check if the compressed file is complete. -v For each compressed and decompressed file, display the file name and compression ratio. -num Adjust the speed of compression with the specified number num, -1 or -fast for the fastest compression method (low compression ratio), -9 or -best for the slowest compression method (high compression ratio). The system default value is 6. Command example:

gzip % compresses each file in the current directory into a .gz file. gzip -dv % Extract each compressed file in the current directory and list detailed information. gzip -l *% Displays detailed information about each compressed file in Example 1, but does not decompress it. gzip usr.tar% Compresses the tar backup file usr.tar, and the extension of the compressed file is .tar.gz.

Guess you like

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