|
The common tar extract the command summary, the memo as:
tar
-c: build archive
-x: Unzip
-t: View content
-r: append to the archive file
-u: update the original archive files
The five independent command, to be used in one of the compression decompression can be used in conjunction with other commands, but only one with them. The following parameters are required in the compression or decompression file optional.
-z: There gzip property
-j: There bz2 property
-Z: There compress attribute
-v: Displays all process
-O: Unlock the files to standard output
The following parameters -f is required
-f: Use file name, remember, this parameter is the last parameter, behind only access the file name.
# Tar -cf all.tar * .jpg
This command 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 to 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, -x is to unlock the meaning of
Compression
tar -cvf jpg.tar * .jpg will pack all jpg files into a directory tar.jpg
tar -czf jpg.tar.gz * .jpg packaged directory jpg files into jpg.tar after all, and its use gzip compression, to generate a gzip compressed package named jpg.tar.gz
tar -cjf jpg.tar.bz2 * .jpg packaged directory jpg files into jpg.tar after all, and it is with bzip2 compression, to generate a bzip2 compressed package named jpg.tar.bz2
tar -cZf jpg.tar.Z * .jpg packaged directory jpg files into jpg.tar after all, and it is compressed with compress, generating a umcompress compressed package named jpg.tar.Z
rar a jpg.rar * compressed .jpg rar format, you need to download rar for linux
zip compression zip jpg.zip * .jpg format, you need to download the zip for linux
Decompression
tar -xvf file.tar extracting tar package
unzip tar.gz tar -xzvf file.tar.gz
unpack tar.bz2 tar -xjvf file.tar.bz2
tar -xZvf file.tar.Z decompression tar.Z
unrar e file.rar decompression rar
decompress zip unzip file.zip
To sum up
Decompress with tar -xvf * .tar
* .gz Using gzip -d or gunzip decompression
* .tar.gz And * .tgz unpack with tar -xzf
* .bz2 With bzip2 -d or decompression with bunzip2
* .tar.bz2 Decompression with tar -xjf
* .Z With uncompress decompress
* .tar.Z Decompression with tar -xZf
* .rar With unrar e-extracting
* .zip Decompression with unzip |
|
|
|