Linux unzip zip, BZ, bz2, Z, GZ, tar (unpack)

Source: Internet
Author: User
Tags bz2 pack rar unpack uncompress

Zip:

Compression:

Zip [-acddffghjjkllmoqrstuvvwxyz$][-b < working directory >][-ll][-n < tail string >][-t < date time >][-< compression efficiency >][compressed file] [ File ...] [-i < template style;] [-x < template style;]

Extract:

Unzip [options] Compress file name. zip

Options:

-X file list to unzip the file, but not include the specified file file.

-V View the compressed Files directory, but do not press.

The-t test file has no damage, but does not understand the pressure.

The-D directory unlocks the compressed file to the specified directory.

-Z displays only annotations for compressed files.

-N does not overwrite files that already exist.

-O overwrites files that already exist and does not require user confirmation.

-j does not recreate the directory structure of the document, extracting all the files into the same directory.

Example:

Example 1: Unzip the compressed file Text.zip in the current directory.

$ unzip Text.zip

Example 2: Extract the compressed file Text.zip in the specified directory/TMP, if the same file exists, ask the unzip command not to overwrite the original file.

$ unzip-n text.zip-d/tmp

Example 3: View the compressed Files directory, but do not understand the pressure.

$ unzip-v Text.zip

Zgrep command

The function of this command is to look for a matching regular expression in a compressed file, using the same as the grep command, except that the object is a compressed file. If the user wants to see if there is a certain word in a compressed file, the Zgrep command is available.

Bz:

Bzip2-d filename.bz

BUNZIP2 filename.bz

BZ2:

Generate Linux-2-4-2.tar using BUNZIP2 linux-2-4-2.tar.bz2
Use tar xvf Linux-2-4-2.tar to get the final file.

or directly using
Tar jxvf linux-2-4-2.tar.bz2

Z:

Uncompress filename.z--decompression

Compress FileName--compression

Gz

*.gz with gzip-d or guzip:

Compression:

Zip [-acddffghjjkllmoqrstuvvwxyz$][-b < working directory >][-ll][-n < tail string >][-t < date time >][-< compression efficiency >][compressed file] [ File ...] [-i < template style;] [-x < template style;]

Extract:

Unzip [options] Compress file name. zip

Options:

-X file list to unzip the file, but not include the specified file file.

-V View the compressed Files directory, but do not press.

The-t test file has no damage, but does not understand the pressure.

The-D directory unlocks the compressed file to the specified directory.

-Z displays only annotations for compressed files.

-N does not overwrite files that already exist.

-O overwrites files that already exist and does not require user confirmation.

-j does not recreate the directory structure of the document, extracting all the files into the same directory.

Example:

Example 1: Unzip the compressed file Text.zip in the current directory.

$ unzip Text.zip

Example 2: Extract the compressed file Text.zip in the specified directory/TMP, if the same file exists, ask the unzip command not to overwrite the original file.

$ unzip-n text.zip-d/tmp

Example 3: View the compressed Files directory, but do not understand the pressure.

$ unzip-v Text.zip

Zgrep command

The function of this command is to look for a matching regular expression in a compressed file, using the same as the grep command, except that the object is a compressed file. If the user wants to see if there is a certain word in a compressed file, the Zgrep command is available.

Bz:

Bzip2-d filename.bz

BUNZIP2 filename.bz

BZ2:

Generate Linux-2-4-2.tar using BUNZIP2 linux-2-4-2.tar.bz2
Use tar xvf Linux-2-4-2.tar to get the final file.

or directly using
Tar jxvf linux-2-4-2.tar.bz2

Z:

Uncompress filename.z--decompression

Compress FileName--compression

Gz

*.gz extract with gzip-d or gunzip

Tar: (pack, not unzip)

TAR–XVF File.tar//Unpacking the TAR Package

Summarize
1, *.tar with TAR–XVF decompression
2, *.gz with gzip-d or gunzip decompression
3, *.tar.gz and *.tgz with TAR–XZF decompression
4, *.bz2 with bzip2-d or with BUNZIP2 decompression
5, *.tar.bz2 with TAR–XJF decompression
6, *. Z Extract with Uncompress
7, *.tar. Z Extract with Tar–xzf
8, *.rar with Unrar e decompression
9, *.zip with unzip decompression

Zip:

Compression:

Zip [-acddffghjjkllmoqrstuvvwxyz$][-b < working directory >][-ll][-n < tail string >][-t < date time >][-< compression efficiency >][compressed file] [ File ...] [-i < template style;] [-x < template style;]

Extract:

Unzip [options] Compress file name. zip

Options:

-X file list to unzip the file, but not include the specified file file.

-V View the compressed Files directory, but do not press.

The-t test file has no damage, but does not understand the pressure.

The-D directory unlocks the compressed file to the specified directory.

-Z displays only annotations for compressed files.

-N does not overwrite files that already exist.

-O overwrites files that already exist and does not require user confirmation.

-j does not recreate the directory structure of the document, extracting all the files into the same directory.

Example:

Example 1: Unzip the compressed file Text.zip in the current directory.

$ unzip Text.zip

Example 2: Extract the compressed file Text.zip in the specified directory/TMP, if the same file exists, ask the unzip command not to overwrite the original file.

$ unzip-n text.zip-d/tmp

Example 3: View the compressed Files directory, but do not understand the pressure.

$ unzip-v Text.zip

Zgrep command

The function of this command is to look for a matching regular expression in a compressed file, using the same as the grep command, except that the object is a compressed file. If the user wants to see if there is a certain word in a compressed file, the Zgrep command is available.

Bz:

Bzip2-d filename.bz

BUNZIP2 filename.bz

BZ2:

Generate Linux-2-4-2.tar using BUNZIP2 linux-2-4-2.tar.bz2
Use tar xvf Linux-2-4-2.tar to get the final file.

or directly using
Tar jxvf linux-2-4-2.tar.bz2

Z:

Uncompress filename.z--decompression

Compress FileName--compression

Gz

*.gz extract with gzip-d or gunzip

Tar: (pack, not unzip)

TAR–XVF File.tar//Unpacking the TAR Package

Summarize
1, *.tar with TAR–XVF decompression
2, *.gz with gzip-d or gunzip decompression
3, *.tar.gz and *.tgz with TAR–XZF decompression
4, *.bz2 with bzip2-d or with BUNZIP2 decompression
5, *.tar.bz2 with TAR–XJF decompression
6, *. Z Extract with Uncompress
7, *.tar. Z Extract with Tar–xzf
8, *.rar with Unrar e decompression
9, *.zip with unzip decompression

Nzip Decompression

Tar: (pack, not unzip)

TAR–XVF File.tar//Unpacking the TAR Package

Summarize
1, *.tar with TAR–XVF decompression
2, *.gz with gzip-d or gunzip decompression
3, *.tar.gz and *.tgz with TAR–XZF decompression
4, *.bz2 with bzip2-d or with BUNZIP2 decompression
5, *.tar.bz2 with TAR–XJF decompression
6, *. Z Extract with Uncompress
7, *.tar. Z Extract with Tar–xzf
8, *.rar with Unrar e decompression
9, *.zip with unzip decompression

Linux unzip zip, BZ, bz2, Z, GZ, tar (unpack)

Related Article

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.