After installing the RAR command in centos, the zip command is automatically installed.
Click here for specific installation.
Run the following commands in the/home directory:
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
========================================================== ==================
Main Parameter-C: extract the result-L: display the compressed file-P: similar to the-C parameter, the extracted result is displayed on the screen, but will not execute any conversion-T: Check whether the compressed file is correct-u: similar to the-F parameter, but apart from updating the existing file, it will also decompress other files in the compressed file to the directory.-V: The detailed information is displayed when execution is performed.-Z: only the remarks of the compressed file are displayed.-: perform necessary character conversion for text files-B: do not perform character conversion for text files-C: file names in compressed files are case sensitive-J: do not compress the original directory path-L: change all file names in the compressed file to lowercase-M: Send the output result to moreProgramProcessing-N: Do not overwrite the original file during decompression-O: Do not ask the user first. After unzip is executed, overwrite the original file-P<Password>: Use the zip password option-Q: No information is displayed during execution-S: Convert the blank characters in the file name to the bottom line character-V: retain the VMS file version information-X: decompress the package and save the original UID/GID of the file.