takes
-c: establish compressed file
-x: unzip
-t: view the contents
-r: append to the archive file
-u: update the original file compression package
The five independent command, should be used where a compression decompression can be used in conjunction with other commands, but can only use one of them. The following parameters are required when optional file compression or decompression.
-z: gzip attribute has
-j: There bz2 attribute
-Z: There compress attribute
-v: show all processes
-O: to standard output file will unlock
The following parameters are necessary -f
-f: Use file name, remember, this parameter is the last parameter, behind only access the file name.
# Tar -cf all.tar * .jpg
This Order is all .jpg files labeled as a package called all.tar. -c is to generate new packages, -f specify the package file name.
# Tar -rf all.tar * .gif
This command is all. .Gif files added all.tar package to go inside. -r is meant to increase the file.
# Tar -uf all.tar logo.gif
This command is to update the original tar package all.tar the logo.gif file, -u is the meaning of the update file.
# Tar -tf all.tar
This command is to list all the files all.tar package, -t is the meaning of the listed files
# tar -xf all.tar
This command is solved all.tar package all the files, -t is to unlock the meaning of
compression
tar -cvf jpg.tar * .jpg // directory to package all jpg files into jpg.tar
After the tar -czf jpg.tar.gz * .jpg // directory to package all jpg files into jpg.tar, and its use gzip compression to generate a gzip compressed package named jpg.tar.gz
After the tar -cjf jpg.tar.bz2 * .jpg // directory to package all jpg files into jpg.tar, and it is compressed with bzip2, to generate a bzip2 compressed package named jpg.tar.bz2
After the tar -cZf jpg.tar.Z * .jpg // directory to package all jpg files into jpg.tar, and its use compress compression, produces a umcompress compressed package named jpg.tar.Z
rar a jpg.rar * .jpg // rar compressed format, you need to download rar for linux
zip jpg.zip * .jpg // compressed zip format, you need to download the zip for linux
Decompression
tar -xvf file.tar // extract the tar package
tar -xzvf file.tar.gz // 解压 tar.gz
tar -xjvf file.tar.bz2 // 解压 tar.bz2
tar -xZvf file.tar.Z // 解压 tar.Z
unrar e file.rar // decompression rar
unzip file.zip // extract the zip
to sum up
1, *. Tar decompress with tar -xvf
2, *. Gz gzip -d or gunzip it with
3, *. Tar.gz and * .tgz unpack with tar -xzf
4, *. Bz2 bzip2 -d or by extracting with bunzip2
5, *. Tar.bz2 decompression with tar -xjf
6, *. Z with uncompress unpack
7, *. Tar.Z with tar -xZf decompression
8, *. Rar extracting with unrar e
9, *. Zip unzip it with