[Reserved] Linux unzip command

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, -x is to unlock the meaning of 

compression

-cvf jpg.tar * .jpg tar  // directory where all jpg pack files into tar.j PG

* .jpg -czf jpg.tar.gz tar    // directory where all jpg pack files into jpg.tar after, and its use gzip compression to generate a gzip compressed package named jpg.tar.gz

* .jpg -cjf jpg.tar.bz2 tar  // directory where all jpg pack files into jpg.tar after, and its use bzip2 compression, to generate a bzip2 compressed package named jpg.tar.bz2

* .jpg -czf jpg.tar.Z tar    // directory where all jpg pack files into jpg.tar after, 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 // zip compression format, you need to download the zip for linux

Decompression

file.tar -xvf tar  // extract the  tar package

filetargz xzvf tar  // jie_ya targz

filetarbz2 xjvf tar    // jie_ya  tar.bz2

filetarZ xZvf tar    // jie_ya tarZ

E file.rar unrar  // decompression rar

unzip file.zip // extract the zip

to sum up

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 use bunzip2  decompression

5, *. Tar.bz2 with tar -xjf  decompression

6, *. Z  with  uncompress  unpack

7, *. Tar.Z  with tar -xZf  decompression

8, *. Rar  used  unrar e decompression

9, *. Zip  with  unzip  unzip

Reproduced in: https: //www.cnblogs.com/Leon5/archive/2011/10/02/2198089.html

Guess you like

Origin blog.csdn.net/weixin_33936401/article/details/93948125
Recommended