1, *.tar with TAR–XVF decompression2, *.gz with gzip-d or gunzip decompression3, *.tar.gz and *.tgz with TAR–XZF decompression4, *.bz2 with bzip2-d or with BUNZIP2 decompression5, *.tar.bz2 with TAR–XJF decompression6, *. Z Extract
.
-D. decompress the compressed file.
-L the following fields are displayed for each compressed file:
Compressed)
Uncompressed File Size)
Compression Ratio (ratio)
Uncompressed_name)
-R recursively searches for the specified directory and compresses all the files or decompress the files.
-T test to check whether the compressed file is complete.
-V displays the file name and compression ratio for each compressed and decompressed file.
-Num: Use the specified numeric num to adjust the compression
directory into a. gz file.
$ cd/home
$ gzip *
$ ls
123.gz aaa.gz abc.gz
Example 2: Unzip each compressed file in Example 1 and list detailed information.
$ GZIP-DV *
123.gz: -50.0%--Replaced with 123Aaa.gz: -50.0%--Replaced with AAAAbc.gz: -50.0%--Replaced with ABC
$ ls
123 AAA ABC
Example 3: Details the information of each compressed file in Example 1 and does
detailed information.$ GZIP-DV * 123.gz: -50.0%--replaced with 123 aaa.gz: -50.0%--Replaced with AAA abc.gz: -50.0%--Replaced with ABC$ ls123 AAA ABCExample 3: Detailed Example 1 shows the information of each compressed file, and does not understand the pressure.$ gzip-l *Compressed uncompressed ratio uncompressed_name4 -50.0% 1234 -50.0% AAA4 -50.0% ABC About -416.7% (totals)$ ls123.gz aaa.gz abc.gzExa
with. bz2bzip2-D all.bz2bunzip2all.bz25) for files ending with tar.bz2Tar-XJF all.Tar. bz26) for. Z End of File uncompress all. Z7For.Tar. Z End of FileTar-xzf all.Tar. Z also for common compressed files under window, zip and. Rar,linux have the appropriate methods to decompress them:1For.ZipLinux provides a zip and unzip program, ZIP is a compression program, unzip is the decompression program. They have a lot of parameter options, here is a brief introduction, still give an example of its usa
examples to illustrate their usage:
# Rar a all *. jpgThis command is to compress all. jpg files into a rarpackage named all.rar. this program willThe extension name is automatically appended to the package name.
# Unrar e all.rarThis command is to extract all files from all.rar.
So far, we have introduced tar, Gzip, gunzip, Bzip2, bunzip2, compress in Linux., Uncompress, zip、unzip、rar、unrar, you should ha
Parameter options. Here we will only give a brief introduction and give examples to illustrate their usage:
# Rar a all *. jpgThis command is to compress all. jpg files into a rarpackage named all.rar. this program willThe extension name is automatically appended to the package name.
# Unrar e all.rarThis command is to extract all files from all.rar.
So far, we have introduced tar, Gzip, gunzip, Bzip2, bun
used to extract all files in the all.tar package.-X is used to unlock the file.
The above is the most basic usage of tar. To help you compress or decompress files while packing and unpackage, tar provides a special feature. This means that tar can call other compression programs, such as gzip and Bzip2, while packagin
Linux under the compression, decompression command a variety of, unlike in Windows next WinRAR fight all over the world without rival, exclusively. rar. zip format.For example, the commonly used tar tar.gz tar.bz2 under Linux. Z and so on. The CPU time and compression ratios of each compression and decompression method vary greatly. Here I would like to enumerate, I hope the inappropriate, please advise. --
Summarizes the compression and decompression methods of compressed packets in various formats under Linux. But some of the methods I did not use, but also not all, I hope you can help me to add, I will revise the perfect at any time, thank you!. Tar unpack: Tar xvf Filename.tar package: Tar cvf filename.tar DirName (Note: Tar
extension:# Rpm2cpio file. RPM | cpio-Div12. Install files with the. Deb extension:# Dpkg-I file. Deb13. decompress the file with the. Deb extension:# Dpkg-Deb-fsys-tarfile file. Deb | tar xvf-ar PFile. Deb data.tar.gz | tar xvzf-14.files with the extension of .zip:# Unzip file.zipDecompress WinZip files in LinuxIf JDK is installed, you can use the jar command and the unzip command.Directly decompress the
:# Rpm2cpio file. RPM | cpio-Div12. Install files with the. Deb extension:# Dpkg-I file. Deb13. decompress the file with the. Deb extension:# Dpkg-Deb-fsys-tarfile file. Deb | tar xvf-ar PFile. Deb data.tar.gz | tar xvzf-14.files with the extension of .zip:# Unzip file.zipDecompress WinZip files in LinuxIf JDK is installed, you can use the jar command and the unzip command.Directly decompress the .tar.gz Fi
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.zipExample 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/tmpExample 3: View the compressed Files directory, but do not understand the
:
#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
. 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 decompres
: The compressed file is in. xz format, and the suffix is alsoXz/path/to/somefile after compression is complete, the original file is deleted, the compressed file is named after the source file, and the suffix is added automatically-K: Keep the original file when compressingUNXZ: Unzip the. xz format file and delete the original file after decompression-------------------------------------------------------------------Zip: Compressed file is in. zip format, suffix is also trueZip Filename.zip FI
Today, I encountered a problem in my project. In this project, I need to develop a PC tool (Windows Required). In this case, I need to package some files into a gz file, the gz file is a compressed file in the UNIX system. Later, I found the online resources and only decompressed the C ++ source code. I didn't tell you how to compress the file in the
In the project, you have encountered a problem. In the project, you need to develop a PC tool (Windows Required). In this case, you need to package some files into a gz file, the gz file is a compressed file in the UNIX system. Later, I found the online resources and only decompressed the C ++ source code. I didn't tell you how to compress the file in the
We often encounter packages packaged in. gz format, which is not an executable automatic installation package, which is equivalent to a ZIP package, which is the process of manually extracting, editing, configuring environment variables. You can compress a GZ file by using the following command:Tar zxvf Parameter description:Z-to filter the gzip file, that is, only the specified
1, first of all, we first say why there are three formats:(1) RAR format: RAR format is the first compression method, it is mainly used for the compression of some files of commercial organizations, it can be based on the requirements of different companies, to set up different compression algorithms, this algorithm is not public, security is relatively high, but he is charged.(2) Zip format: Because of the RAR format charges, will inevitably be born some free compression format, then zip is bor
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.