Linux various formats compressed under compression, decompression method. But I did not use part of the method, it was incomplete, I hope you help me add that I will be ready to revise and improve, thank you!
tar
Unpack: tar xvf FileName.tar
Package: tar cvf FileName.tar DirName
(Note: tar is packaged, not compressed!)
———————————————
.gz
Extracting 1: gunzip FileName.gz
Decompression 2: gzip -d FileName.gz
Compression: gzip FileName
.tar.gz 和 .tgz
Decompression: tar zxvf FileName.tar.gz
压缩:tar zcvf FileName.tar.gz DirName
———————————————
.bz2
Extracting 1: bzip2 -d FileName.bz2
Decompression 2: bunzip2 FileName.bz2
Compression: bzip2 -z FileName
tar.bz2
Decompression: tar jxvf FileName.tar.bz2 or tar --bzip xvf FileName.tar.bz2
Compression: tar jcvf FileName.tar.bz2 DirName
———————————————
.bz
Extracting 1: bzip2 -d FileName.bz
Decompression 2: bunzip2 FileName.bz
Compression: Unknown
.tar.bz
Decompression: tar jxvf FileName.tar.bz
Compression: Unknown
———————————————
.WITH
Decompression: uncompress FileName.Z
Compression: compress FileName
.tar.Z
Decompression: tar Zxvf FileName.tar.Z
Compression: tar Zcvf FileName.tar.Z DirName
———————————————
.zip
Decompression: unzip FileName.zip
Compression: zip FileName.zip DirName
Compress a directory using -r parameter, -r recursively. Example: $ zip -r FileName.zip DirName
———————————————
.rar
Decompression: rar x FileName.rar
压缩:rar a FileName.rar DirName
rar please go to: http: //www.rarsoft.com/download.htm download!
Please unzip rar_static copied to / usr / bin directory (other specified by the $ PATH environment variable can):
[root@www2 tmp]# cp rar_static /usr/bin/rar
———————————————
.lha
Decompression: lha -e FileName.lha
Compression: lha -a FileName.lha FileName
lha go to: http: //www.infor.kanazawa-it.ac.jp/~ishii/lhaunix/ download!
> After extracting lha Please copied to / usr / bin directory (other specified by the $ PATH environment variable can):
[root@www2 tmp]# cp lha /usr/bin/
———————————————
.rpm
解包:rpm2cpio FileName.rpm | cpio -div
———————————————
.deb
解包:ar p FileName.deb data.tar.gz | tar zxf -
———————————————
Network .tgz .tar.gz .tar.Z .tar.bz .tar.bz2 .zip .cpio .rpm .I .slp .arj .rar .ace .lha .lzh .lzx .lzs .arc .sda .sfx .lnx .zoo .cab .kar .cpt .pit .sit .sea
Decompression: sEx x FileName *.
Compression:. SEx a FileName * FileName
sEx just call the relevant program itself has no compression, decompression, please note!
sEx go to: http://sourceforge.net/projects/sex download!
Please unzip sEx copied to / usr / bin directory (other specified by the $ PATH environment variable can):
[Root @ www2 tmp] # cp sEx / usr / bin / Linux under common file decompression method and order
System · System
1. .a extension of the file:
#tar xv file.a
2. .z file extensions:
#uncompress file.Z
3. .gz file extensions:
#gunzip file.gz
4. to .bz2 file extensions:
#bunzip2 file.bz2
5. .tar.Z to file extensions:
#tar xvZf file.tar.Z
或 #compress -dc file.tar.Z | tar xvf
6. To .tar.gz / .tgz file extension:
#tar xvzf file.tar.gz
或 gzip -dc file.tar.gz | tar xvf -
7. to .tar.bz2 file extensions:
#tar xvIf file.tar.bz2
或 bzip2 -dc file.tar.bz2 | xvf -
8. to .cpio.gz / .cgz file extensions:
#gzip -dc file.cgz | cpio -div
9. to .cpio / cpio file extensions:
#cpio -div file.cpio
或cpio -divc file.cpio
10. On a .rpm file extension is installed:
#rpm -i file.rpm
11. .rpm file extension to decompress:
#rpm2cpio file.rpm | cpio -div
12. to .deb file extension is installed:
#dpkg -i file.deb
13. .deb file extension to decompress:
#dpkg-deb -fsys-tarfile file.deb | tar xvf - ar p
Failkdeb Detaktrkgz | tar xvzf -
14. The extension to .zip files:
#unzip file.zip
Extracting Winzip file format under linux
If jdk installed, you can use the jar command; unzip command may also be used.
Directly extract .tar.gz files
xxxx.tar.gz file using tar with zxvf parameters, you can unpack once opened. XXXX for the file name. E.g:
$ Tar zxvf xxxx.tar.gz various compression and decompression of files (Installation)
Unzip the file extension (Installation)
.a ar xv file.a
.From uncompress file.Z
.gz gunzip file.gz
.bz2 bunzip2 file.bz2
.tar.Z tar xvZf file.tar.Z
compress -dc file.tar.Z | tar xvf -
.tar.gz / .tgz tar xvzf file.tar.gz
gzip -dc file.tar.gz | tar xvf -
.tar.bz2 tar xvIf file.tar.bz2
bzip2 -dc file.tar.bz2 | xvf -
.cpio.gz/.cgz gzip -dc file.cgz | cpio -div
.cpio/cpio cpio -div file.cpio
cpio -divc file.cpio
.rpm/install rpm -i file.rpm
.rpm/extract rpm2cpio file.rpm | cpio -div
.deb/install dpkg -i file.deb
.deb/exrtact dpkg-deb -fsys-tarfile file.deb | tar xvf -
ar p file.deb data.tar.gz | tar xvzf -
.zip unzip file.zip
bzip2 -d myfile.tar.bz2 | tar xvf
tar xvfz myfile.tar.bz2
x is decompressed
v is the complex output
f is specified file
z gz format
gzip
gzip [options] to be compressed (or uncompressed) file name
-c writes output to standard output, and retain the original file.
-d compressed file compression.
-l for each compressed file, it displays the following fields: compressed file size, uncompressed file size, compression ratio, the name of the uncompressed file
-r recursively find the specified directory and compress all files or compress them.
-t test compressed file is being complete.
-v to decompress each compressed file, it displays the file name and compression ratio.
-num- compressed digital adjustment with the specified speed.
For example:
The / usr directory and its subdirectories, including all the documents to make a backup, the backup file is named usr.tar
tar cvf Usrktr / Home
The / usr directory and its subdirectories, including all files backed up and do a compressed backup file name is usr.tar.gz
tar czvf Usrktrkgsh / Usr
Compress a group of files, file extension is tar.gz
#tar CVF back.tar / reverse /
#gzip -q back.tar
or
#tar cvfz back.tar.gz /back/
Release a suffix tar.gz file.
#tar zxvf back.tar.gz
#gzip back.tar.gz
#tar xvf back.tar