Linux zip/unzip Command __linux

Source: Internet
Author: User
Tags extract zip file unzip extract

A. zip command
Feature Description: Zip is a compressed file command, and the file is compressed to produce a compressed file with a ". zip" extension.
Syntax

Parameters
-A adjusts the executable automatic decompression file.
-b< working directory > Specifies the directory where files are temporarily stored.
-C adds a comment for each compressed file.
-d deletes the specified file from the compressed file.
The directory name is not established in the-D compressed file.
-F The effect of this parameter is similar to the specified "-u" parameter, but not only the existing file is updated, but if some files do not exist in the compressed file, this parameter will be added to the compressed file together.
-F attempts to repair a corrupted compressed file.
-G compresses the file and attaches it to the existing compressed file instead of creating a new compressed file.
-H online Help.
-i< template Style > compress only the eligible files.
-j only saves the file name and its contents, without any directory names.
-J Delete unnecessary data before compressing the file.
-K uses a file name in MS-DOS-compliant format.
-L replaces the LF character with the LF+CR character when compressing the file.
When-ll compressed files, replace the LF+CR characters with the LF character.
-L displays copyright information.
-M to compress the file and add the compressed file, delete the original file, that is, move the file to the compressed file.
-n< string > Do not compress files with a specific character end string.
-O Sets the time to change the compressed file to the same file as the file that has the latest change time in the compressed file.
-Q does not display the instruction execution process.
-R recursive processing of all files and subdirectories under the specified directory.
-S contains system and hidden files.
-t< Date Time > Set the date of the compressed file to the specified date.
-T checks that each file in the backup file is correct.
-U replaces the newer file with the compressed file.
-V Displays the instruction execution process or display version information.
-V Saves the file properties of the VMS operating system.
-W in the file name if the version number, this parameter is only valid under the VMS operating system.
-x< template style > exclude eligible files when compacting.
-X does not save additional file attributes.
-Y saves the symbolic connection directly, not the file that the connection points to, and this parameter is valid only for systems such as UNIX.
-Z Adds a comment for the compressed file.
-$ the volume name of the disk on which the first compressed file is stored.
-< compression Efficiency > Compression efficiency is a value between 1-9.

two. Unzip command
Function Description: Unzip extract zip file command
Syntax

Parameters
-C Displays the uncompressed results to the screen and converts the characters appropriately.
-F to update existing files.
-L Displays the files contained within the compressed file.
-P, similar to the-c parameter, displays the uncompressed results to the screen, but does not perform any transformations.
-T check that the compressed file is correct.
-U is similar to the-f parameter, but in addition to updating an existing file, the other files in the compressed file are uncompressed to the directory.
-V displays detailed information when it is executed.
-Z Displays only the memo text for the compressed file.
-A makes the necessary character conversions to the text file.
-B Do not convert text files to characters.
The file name in the-C compressed file is case-sensitive.
-J does not handle the directory path in the compressed file.
-L Change all file names in the compressed file to lowercase.
-M sends output to more program processing.
-N uncompressed does not overwrite the original file.
-O does not need to ask the user first, overwriting the original file after unzip execution.
-p< Password > Use zip password option.
-Q does not display any information at execution time.
-S converts the whitespace character in the file name to the bottom line character.
-V preserves file version information for VMS.
-X to save the original uid/gid of the file while decompressing.
-d< directory > Specifies the directory to store after the file is uncompressed.
-x< file > Specify which files in the. zip compressed file should not be processed.
-Z unzip-z equals execute zipinfo Instruction

three. Use the example
1. Compresses all dianping_url_201507 files in the current directory into Dianping_url_20150720.zip
[root@w01 groupon]# zip dianping_url_20150720.zip dianping_url_201507*
2. Compress the Abc.txt and Dir1 directories in the current directory into Abc.zip:
[root@w01 groupon]# zip-r abc.zip abc.txt dir1
3. Extract Dianping_url_20150720.zip to the current directory
[root@w01 groupon]# unzip Dianping_ur L_20150720.zip
4. There are Abc1.zip,abc2.zip and Abc3.zip in the current directory, and I want to decompress them together:
[root@w01 groupon]# unzip?. Zip

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.