1.zip command
Zip-r myfile.zip./*
All files and folders under the current directory are compressed into myfile.zip files, and-R indicates that all files in the subdirectory are compressed recursively.
2.unzip command
Unzip-o-d/home/sunny Myfile.zip
Unzip the Myfile.zip file to/home/sunny/
-O: Overwrite the file without prompting;
-d:-d/home/sunny indicates that the file is extracted to the/home/sunny directory;
3. Other
zip-d Myfile.zip Smart.txt
To delete a smart.txt file in a compressed file
Zip-m Myfile.zip./rpm_info.txt
To add a rpm_info.txt file to a myfile.zip in a compressed file
-------------------------------------------------------------------------------
To compress a file using Zip, type the following command at the shell prompt:
Zip-r Filename.zip Filesdir
In this example, Filename.zip represents the file you created, and Filesdir represents the directory where you want to place the new zip file. The-r option specifies that you want to recursively (recursively) include all files included in the Filesdir directory.
To extract the contents of a zip file, type the following command:
Unzip Filename.zip
You can use the zip command to work with multiple files and directories at the same time by listing them one after the other with a space interval:
Zip-r filename.zip file1 file2 file3/usr/work/school
The above command compresses the contents of the File1, File2, File3, and/usr/work/school directories (assuming this directory exists) and then puts them in the Filename.zip file.
rpm: Compression (Zip) decompression under Linux (unzip) indent command
Compression (Zip) decompression (unzip) scaling command under Linux