Linux zip file decompression commands are: 1. Compress the mydata directory [zip -r mydata.zip mydata]; 2. Decompress mydata [unzip mydata.zip -d mydatabak]; 3. Extract to the home directory [unzip ..].
The Linux zip file decompression commands are:
1. Compress the mydata directory under the /home directory into mydata .zip
zip -r mydata.zip mydata #压缩mydata目录
2. Unzip mydata.zip under the /home directory into the mydatabak directory
unzip mydata.zip -d mydatabak
3. Compress the abc folder and 123.txt under the /home directory into abc123 .zip
zip -r abc123.zip abc 123.txt
4. Extract the wwwroot.zip under the /home directory directly into the /home directory
unzip wwwroot.zip
5. Unzip abc12.zip, abc23.zip under the /home directory. abc34.zip is also decompressed into the /home directory
unzip abc*.zip
6. Check the contents of wwwroot.zip under the /home directory
unzip -v wwwroot.zip
7. Verify the wwwroot.zip under the /home directory Is it complete
unzip -t wwwroot.zip
8. Unzip all the files in wwwroot.zip under the /home directory to the first-level directory
unzip -j wwwroot.zip
Main parameters
-c: The decompression result
-l: Display the files contained in the compressed file
-p: Similar to the -c parameter, the decompression result will be displayed on the screen , but will not perform any conversion
-t: Check whether the compressed file is correct
-u: Similar to the -f parameter, but in addition to updating the existing file, the compression will also be Decompress other files in the file into the directory
-v: Display detailed information when executing
-z: Display only the remark text of the compressed file
-a : Perform necessary character conversion on text files
-b: Do not perform character conversion on text files
-C: File names in compressed files are case-sensitive
- j: Do not process the original directory path in the compressed file
-L: Change all file names in the compressed file to lowercase
-M: Send the output results to the more program for processing
-n: Do not overwrite the original file when decompressing
-o: No need to ask the user first, overwrite the original file after unzip is executed
-P: Use the zip password Options
-q: Execute without displaying any information
-s: Convert whitespace characters in the file name to underscore characters
-V: Preserve the file version of the VMS Information
-X: When decompressing, the original UID/GID of the file is restored at the same time
Related learning recommendations: linux video tutorial
The above is the detailed content of What are the commands to decompress linux zip files?. For more information, please follow other related articles on the PHP Chinese website!