Detailed description of CentOS zip and unzip commands

Source: Internet
Author: User
Run the following commands in the/home directory: cd/home # go to the/home directory. 1. compress the mydatadirectory under the/home directory into mydata.zipzipzip-rmydata.zip mydata # compress the mydata Directory. 2. run the following commands in/home: directory operations
Cd/home # enter the/home directory
1. compress the mydatafile under the/home directory as mydata.zip.
Zip-r mydata.zip mydata # compress the mydata Directory
2. decompress mydata.zip in the/homecatalog to the mydatabak directory.
Unzip mydata.zip-d mydatabak
3. compress the abcfolder and 123.txtfile under the/home directory into abc123.zip

Zip-r abc123.zip abc 123.txt
4. extract the wwwroot.zip file in the/homedirectory to the/home directory.

Unzip wwwroot.zip
5. decompress abc12.zip、abc23.zip、abc34.zip in the/homedirectory to the/home directory at the same time.

Unzip abc \ *. zip
6. view the content in wwwroot.zip under/homecontents.

Unzip-v wwwroot.zip
7. verify that the wwwroot.zip file under/homedirectory is complete

Unzip-t wwwroot.zip
8. decompress all the files in wwwroot.zip under the/homedirectory to the first level Directory.

Unzip-j wwwroot.zip
System O & M reminder: qihang01 original content is copyrighted. For more information, see the source and original article links.
========================================================== ==================
Main parameters
-C: extract the result
-L: displays the files contained in the compressed file.
-P: similar to the-c parameter, the extracted result is displayed on the screen, but no conversion is performed.
-T: Check whether the compressed file is correct.
-U: similar to the-f parameter. However, in addition to updating existing files, other files in the compressed files will be decompressed to the directory.
-V: Detailed information is displayed when execution is performed.
-Z: only the remarks of the compressed file are displayed.
-A: necessary character conversion for text files
-B: do not convert characters in text files.
-C: The file name in the compressed file is case sensitive.
-J: The original directory path of the compressed file is not processed.
-L: Change all file names in the compressed file to lowercase letters.
-M: Send the output result to the more Program for processing.
-N: do not overwrite the original file during decompression.
-O: no need to ask the user first. after unzip is executed, the original file will be overwritten.
-P <密码> : Use the zip password option
-Q: No information is displayed during execution.
-S: converts the blank characters in the file name to the bottom line characters.
-V: retain the file version information of VMS.
-X: saves the original UID/GID of the file at the same time.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.