Instance
tar-zcvf/home/ecshopa/public_html/uggbootf20101214.tar.gz * Enter directory to compress all files under current directory
Tar-zxvf/home/uggbootf/public_html/uggbootf20101214.tar.gz into directory to extract to current directory
Command
Unzip-o-d/var/lib/mysql Mysql43.194-20101230.zip
Tar command detailed
-C: Set up compressed files
-X: Decompression
-T: viewing content
-R: Appending files to the end of a compressed archive
-U: Updating files in original compressed package
These five are independent commands, compression decompression to use one of them, can be used with other commands but only one. The following parameters are optional when compressing or decompressing files as needed.
-C: Set up compressed files
-X: Decompression
-T: viewing content
-R: Appending files to the end of a compressed archive
-U: Updating files in original compressed package
The following parameter-F is required
-F: Use the file name, remember, this parameter is the last parameter, only the file name can be followed.
# TAR-CF All.tar *.jpg
This command is to make all. jpg files into a package named All.tar. -C indicates the creation of a new package,-f Specifies the file name of the package.
# TAR-RF All.tar *.gif
This command adds all the. gif files to the All.tar package. -R means to add a file.
# Tar-uf All.tar logo.gif
This command updates the logo.gif file in the original tar package All.tar, and-U is the meaning of the update file.
# TAR-TF All.tar
This command lists all the files in the All.tar package----------T is the list of files
# TAR-XF All.tar
This command is to solve all the files in the All.tar package----------T is untied
Compression
TAR–CVF Jpg.tar *.jpg//pack all JPG files in the directory into tar.jpg
TAR–CZF jpg.tar.gz *.jpg//pack all JPG files in the directory into Jpg.tar, and use gzip compression to generate a gzip compressed package named jpg.tar.gz
TAR–CJF jpg.tar.bz2 *.jpg//packages all JPG files in the directory into Jpg.tar, and uses bzip2 compression to generate a BZIP2 compressed package named jpg.tar.bz2
TAR–CZF jpg.tar.z *.jpg//packages all JPG files in the directory into Jpg.tar, and uses compress compression to generate a umcompress compressed package named Jpg.tar.z
RAR a jpg.rar *.jpg//rar format compression, you need to download RAR for Linux
Zip jpg.zip *.jpg//zip format compression, you need to first download zip for Linux
Extract
TAR–XVF File.tar//Extract tar Pack
TAR-XZVF file.tar.gz//Decompression tar.gz
TAR-XJVF file.tar.bz2//Decompression tar.bz2
TAR–XZVF File.tar.z//extract tar. Z
Unrar e file.rar//decompression rar
Unzip File.zip/Unzip zip
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 with uncompress decompression
7, *.tar. Z with TAR–XZF decompression
8, *.rar with Unrar e decompression
9, *.zip with unzip decompression
01-.tar format
Unpack: [*******]$ tar xvf Filename.tar
Packaging: [*******]$ tar cvf filename.tar dirname (Note: Tar is packaged, not compressed!) )
02-.gz format
Decompression 1:[*******]$ Gunzip filename.gz
Decompression 2:[*******]$ gzip-d filename.gz
Compression: [*******]$ gzip FileName
03-.tar.gz format
Decompression: [*******]$ tar zxvf FileName.tar.gz
Compression: [*******]$ tar zcvf FileName.tar.gz dirname
04-.BZ2 format
Decompression 1:[*******]$ bzip2-d filename.bz2
Decompression 2:[*******]$ bunzip2 filename.bz2
Compression: [*******]$ bzip2-z FileName
05-.TAR.BZ2 format
Decompression: [*******]$ tar jxvf FileName.tar.bz2
Compression: [*******]$ tar jcvf FileName.tar.bz2 dirname
06-.BZ format
Decompression 1:[*******]$ bzip2-d filename.bz
Decompression 2:[*******]$ bunzip2 filename.bz
07-.TAR.BZ format
Decompression: [*******]$ tar jxvf FileName.tar.bz
08-. Z Format
Decompression: [*******]$ uncompress filename.z
Compression: [*******]$ compress FileName
09-.tar. Z Format
Decompression: [*******]$ tar zxvf filename.tar.z
Compression: [*******]$ tar zcvf filename.tar.z dirname
10-.TGZ format
Decompression: [*******]$ tar zxvf filename.tgz
11-.TAR.TGZ format
Decompression: [*******]$ tar zxvf FileName.tar.tgz
Compression: [*******]$ tar zcvf FileName.tar.tgz FileName
12-.zip format
Decompression: [*******]$ unzip Filename.zip
Compression: [*******]$ zip Filename.zip dirname
13-.lha format
Decompression: [*******]$ lha-e Filename.lha
Compression: [*******]$ lha-a Filename.lha FileName
14-.rar format
Decompression: [*******]$ rar a Filename.rar
Compression: [*******]$ rar e Filename.rar
Linux Unzip the command encyclopedia
. tar
Unpack: Tar xvf Filename.tar
Packing: Tar cvf filename.tar dirname
(Note: Tar is packed, not compressed!) )
———————————————
. gz
Decompression 1:gunzip filename.gz
Decompression 2:gzip-d filename.gz
Compression: gzip FileName
. tar.gz and. tgz
Decompression: Tar zxvf FileName.tar.gz
Compression: Tar zcvf FileName.tar.gz dirname
———————————————
. bz2
Decompression 1:bzip2-d filename.bz2
Decompression 2:BUNZIP2 filename.bz2
Compression: Bzip2-z FileName
. tar.bz2
Decompression: Tar jxvf FileName.tar.bz2
Compression: Tar jcvf FileName.tar.bz2 dirname
———————————————
. BZ
Decompression 1:bzip2-d filename.bz
Decompression 2:BUNZIP2 filename.bz
Compression: Unknown
. tar.bz
Decompression: Tar jxvf FileName.tar.bz
Compression: Unknown
———————————————
. Z
Decompression: uncompress filename.z
Compression: Compress FileName
. Tar. Z
Decompression: Tar zxvf filename.tar.z
Compression: Tar zcvf filename.tar.z dirname
———————————————
. zip
Decompression: Unzip Filename.zip
Compression: Zip Filename.zip dirname
———————————————
. rar
Decompression: rar x Filename.rar
Compression: rar a filename.rar dirname
———————————————
. Lha
Decompression: Lha-e Filename.lha
Compression: Lha-a Filename.lha FileName
———————————————
. rpm
Unpack: Rpm2cpio filename.rpm | Cpio-div
———————————————
. deb
Unpack: ar p filename.deb data.tar.gz | Tar zxf-
———————————————
. Tar. tgz. tar.gz. Tar. Z. tar.bz. tar.bz2. Cpio. rpm. Arj. Lha. Lzh. Lzx. Lzs. SDA. cab SFX. Lnx. P. SLP. Zoo. it. Sit. Sea
Decompression: sEx x filename.*
Compression: SEx a filename.* FileName
Sex just call the relevant program, itself and no compression, decompression function, please note!
gzip command
Reducing file size has two obvious benefits, one is to reduce storage space, and the other is to transfer files over the network, you can reduce the transmission time. Gzip is a regular use of Linux in the file compression and decompression of the command, both convenient and useful.
Syntax: gzip [option] Compress (uncompress) file name the options for this command have the following meanings:
-C writes the output to the standard output and retains the original file. -D Unzip the compressed file. -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 all of its files or is uncompressed. -T test to check that the compressed file is complete. -V displays filename and compression ratio for each compressed and decompressed file. -num adjusts the speed of the 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 default value for the system is 6. Instruction instance:
Gzip *% compresses each file in the current directory into a. gz file. GZIP-DV *% extracts each compressed file in the current directory and lists detailed information. Gzip-l *% details the information for each compressed file in Example 1 and does not understand the pressure. GZIP usr.tar% Compressed tar backup file Usr.tar, at which time the compressed file extension is. tar.gz.