Compression (Zip) decompression (unzip) scaling command under Linux

Source: Internet
Author: User

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

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.