This article mainly introduced the Zip/unzip Compression decompression command's use method and the parameter explanation, needs the friend may refer to under
1, the/home directory under the MyData directory compression to Mydata.zip
Zip-r Mydata.zip MyData #压缩mydata目录
2, the/home directory below the mydata.zip extract into the Mydatabak directory inside
Unzip mydata.zip-d Mydatabak
3, the/home directory under the ABC folder and 123.txt compression into Abc123.zip
Zip-r abc123.zip ABC 123.txt
4, the/home directory below the Wwwroot.zip directly extracted into the/home directory inside
Unzip Wwwroot.zip
5, the/home directory below the Abc12.zip, Abc23.zip, abc34.zip at the same time extract into the/home directory inside
Unzip Abc*.zip
6, view the contents of the wwwroot.zip below the/home directory
Unzip-v Wwwroot.zip
7, verify the/home directory below the Wwwroot.zip is complete
Unzip-t Wwwroot.zip
8, the/home directory below the wwwroot.zip of all the files extracted to the first level directory
Unzip-j Wwwroot.zip
Main parameters
-C: The uncompressed results
-L: Displays the files contained in the compressed file
-P: Similar to the-c parameter, the uncompressed results are displayed to the screen but no conversions are performed
-T: Check that the compressed file is correct
-u: Similar to the-f argument, However, in addition to updating an existing file, other files in the compressed file are extracted to the directory
-V: Show detailed information when execution is performed
-Z: Only the memo text for compressed Files
-A: Make necessary character conversions to text files
- B: Do not convert text files to characters
-C: Compressed file names in files are case-sensitive
-j: Do not process compressed files in the directory path
-L: Change all file names in compressed file to lowercase
-M: Send output to more program processing
- N: Do not overwrite the original file
-o: Do not need to ask the user first, unzip overwrite the original file after execution
-P: Use the zip password option
-Q: Do not display any information
-s: Converts white space characters in file names to baseline characters
- V: Keep VMs file version information
-X: Back up the original uid/gid at the same time when decompressing