Common solutions for decompression

Source: Internet
Author: User
Tags bz2 gz file uncompress zip extension

Compression decompression
Linux how to solve the suffix name is gzip file.
1. Files with the extension of. A:
#tar XV File.a
2. Files with a. z Extension:
#uncompress file. Z
3. Files with the extension of. GZ:
#gunzip file.gz
4. Files with a. bz2 extension:
#bunzip2 file.bz2
5. Files with a. tar.z extension:
#tar Xvzf File.tar.z
or #compress-dc File.tar.z | Tar xvf-
6. Files with a. tar.gz/.tgz extension:
#tar Xvzf file.tar.gz
or GZIP-DC file.tar.gz | Tar xvf-
7. Files with a. tar.bz2 extension:
#tar xvif file.tar.bz2
or BZIP2-DC file.tar.bz2 | XVF-
8. Files with a. cpio.gz/.cgz extension:
#gzip-DC File.cgz | Cpio-div
9. Files with a. cpio/cpio extension:
#cpio-div File.cpio
or CPIO-DIVC File.cpio
10. Installation of file with the extension of. RPM:
#rpm-I. file.rpm
11. Extract files with the extension of. RPM:
#rpm2cpio file.rpm | Cpio-div
12. Installation of files with a. deb extension:
#dpkg-I. File.deb
13. Unzip files with a. deb extension:
#dpkg-deb--fsys-tarfile File.deb | Tar Xvf-ar P
File.deb data.tar.gz | Tar Xvzf-
14. Files with a. zip extension:
#unzip File.zip
Unpack WinZip files under Linux
If the JDK is installed, you can use the Jar command, or you can use the Unzip command.
Extract the. tar.gz file directly
The xxxx.tar.gz file uses tar with ZXVF parameters and can be unpacked at once. XXXX is the filename. For example:
$tar ZXVF xxxx.tar.gz Decompression of various compressed files (installation method)

File name extension Decompression (installation method)

. A AR XV file.a
. Z 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 decompression
V is a complex output
F is the specified file
Z GZ format

Gzip
gzip[option] to compress (or decompress) the file name
-C writes the output to the standard output and retains the original file.
-D compresses compressed files.
-L Displays the following fields for each compressed file: 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 or compresses all of its files.
-t test compressed file is intact.
-V displays its file name and compression ratio for each compressed and uncompressed file.
-num-adjusts the speed of compression with the specified number.
Example:
Make a backup of all files including the/USR directory and include its subdirectories, backed up with a file named Usr.tar
Tar cvf usr.tar/home
Make a backup and compress all files including the/USR directory and include its subdirectories, and the backup file name is usr.tar.gz
Tar czvf usr.tar.gz/usr
Compresses a set of files with a suffix of tar.gz
#tar CVF back.tar/back/
#gzip-Q Back.tar
Or
#tar CVFZ back.tar.gz/back/
Releases a file with a suffix of tar.gz.
#tar ZXVF back.tar.gz
#gzip back.tar.gz
#tar XVF Back.tar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.