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
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
.
-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
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
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
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
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
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
:# 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
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. -----------------------------------------------
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
Roughly summed up the Linux under the various formats of compression package compression, decompression methods. But some of the methods I did not use, also not all, I hope you help me to add, I will be ready to modify, thank you.
. tar
Unpack: Tar xvf Filename.tar
Packing: Tar cvf filename.tar dirname
(Note: Tar is p
: 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
and compression ratio. -num adjusts the speed of compression with the specified number num,-1 or--fast represents the fastest compression method (low compression ratio), 9 or--best represents the slowest compression method (high compression ratio). The system default value is 6. instruction Example: Gzip *% compress each file in the current directory into a. gz file. GZIP-DV *% extracts each compressed file in the current directory and lists detailed
, display the filename and compression ratio. -num adjusts the speed of compression with the specified number num,-1 or--fast represents the fastest compression method (low compression ratio), 9 or--best represents the slowest compression method (high compression ratio). The system default value is 6.instruction Example:Gzip *% compress each file in the current directory into a. gz file. GZIP-DV *% extracts each compressed file in the current director
tar [-cxtzjvfppn] files and directories ....Parameters:-C: Create a compressed file parameter directive (the meaning of Create);-x: Unlock the parameter instructions for a compressed file!-T: View the files inside the Tarfile!In particular, in the release of the parameters, c/x/t can only exist one! Cannot exist at the same time!Because it is not possible to compress and decompress simultaneously.-Z: Do you have the properties of gzip at the same time
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.