Linux decompression commands

Source: Internet
Author: User
Tags uncompress zip extension

 

. Tar
Unpack: Tar zxvf filename.tar
Package: Tar czvf filename.tar dirname
---------------------------------------------
. 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
Extract 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 a filename.rar
Compression: R ar e filename.rar

RAR Please download to: http://www.rarsoft.com/download.htm!
After decompression, copy rar_static to the/usr/bin directory (Other Directories specified by the $ PATH environment variable can also be used ):
[Root @ www2 TMP] # cp rar_static/usr/bin/RAR
---------------------------------------------
. LHA
Decompress: LHA-e filename. LHA
Compression: LHA-a filename. LHA filename

Lha please: http://www.infor.kanazawa-it.ac.jp /~ Ishii/lhaunix/download!
> After decompression, copy LHA to the/usr/bin directory (Other Directories specified by the $ PATH environment variable can also be used ):
[Root @ www2 TMP] # cp LHA/usr/bin/
---------------------------------------------
. Rpm
Unpack: rpm2cpio filename. RPM | cpio-Div
---------------------------------------------
. Deb
Unpack: Ar P filename. Deb data.tar.gz | tar zxf-
---------------------------------------------

 

Linux decompression commands

in Linux, how does one resolve a file with a suffix of gzip?
1. to. files with the extension A:
# tar XV file. A
2. to. files with Z Extension:
# uncompress file. z
3.files with the extension .gz:
# gunzip file.gz
4.files with the extension .bz2:
# bunzip2 file.bz2
5..tar. files with Z Extension:
# tar xvzf file.tar. z
or # compress-DC file.tar. z | tar xvf-
6.to .tar.gz /. files with the tgz Extension:
# tar xvzf file.tar.gz
or gzip-DC file.tar.gz | tar xvf-
7.files with the extension of .tar.bz2:
# tar xvif file.tar.bz2
or Bzip2-DC file.tar.bz2 | xvf-
8. .cpio.gz /. files with the cgz Extension:
# gzip-DC file. cgz | cpio-Div
9. to. cpio/cpio files with the extension:
# cpio-Div file. cpio
or cpio-divc file. cpio
10. to. file Installation with RPM Extension:
# rpm-I file. rpm
11. to. decompress the file with the RPM Extension:
# rpm2cpio file. rpm | cpio-Div
12. to. deb extension File Installation:
# dpkg-I file. deb
13. to. decompress a file with the 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

Decompress WinZip files in Linux
If JDK is installed, you can use the jar command and the unzip command.
Directly decompress the .tar.gz File
The xxxx.tar.gz file uses tar with the zxvf parameter and can be decompressed once. XXXX is the file name. For example:
$ Tar zxvf xxxx.tar.gz
Decompress the compressed files (Installation Method)

Decompress the file extension (Installation Method)

. A Ar XV file.
. 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-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] file name to be compressed (or decompressed)
-C writes the output to the standard output and keeps the original file.
-D: compress the compressed file.
-L for each compressed file, the following fields are displayed: size of the compressed file, size of the uncompressed file, and Compression

Ratio, uncompressed file name
-R recursively searches for the specified directory and compresses or compresses all the files in it.
-T to test whether the compressed file is complete.
-V shows the file name and compression ratio of each compressed and decompressed file.
-Num-adjust the compression speed with the specified number.
Example:
Create a full file named usr.tar in the full directory of the/usrdirectory.
Tar CVF usr.tar/home
Back up all the files in the/usr directory, including its subdirectories, and compress them. Back up the file name.

Usr.tar.gz
Tar czvf usr.tar.gz/usr
A group of files with the suffix tar.gz
# Tar CVF back.tar/back/
# Gzip-Q back.tar
Or
# Tar cvfz back.tar.gz/back/
Release a file suffixed with 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.