Linux command: zip package and decompress

Source: Internet
Author: User
The preceding command is to compress files and folders with an absolute address. the following shows the basic usage of the linux zip command for compressing the relative path directory:

Zip [parameter] [package file name] [package directory path]

Linux zip command parameter list:

-A converts a file to ASCII mode.
-F try to repair damaged compressed files
-H: Display the help page
-M: After compressing the file, delete the source file.

-N the specified string does not compress the file with the specified character string.
-O sets the latest change time of all files in the compressed file to the compression time.
-Q Quiet mode. the command execution process is not displayed during compression.
-R processes all subdirectories and files in the specified directory together.
-S contains system files and implicit files (S is capital)
-T date: set the last modification date of the compressed file to the specified date. The date format is mmddyyyy.

Example:

Pack all the files and files in the/home/Blinux/html/directory into the html.zip file under the current directory.

Zip-q-r html.zip/home/Blinux/html

The preceding command compresses the files and folders of the absolute address.

For example, in the Bliux directory, you can perform the following operations to achieve the same effect.

Zip-q-r html.zip html

For example, the zip compression command in my html directory is

Zip-q-r html.zip *

The preceding operations are performed in quiet mode and contain system files and hidden files.
//////////////////////////////////////// //////////////////
Unzip syntax:

Unzip [-cflptuvz] [-agCjLMnoqsVX] [-P <密码> [[.Zip file] [file] [-d <目 录> ] [-X <文件> ] Or unzip [-Z]

Note: unzipis the decompression program for. ZIP compressed files.



Unzip parameters:
-C displays the extracted results on the screen and converts the characters properly.
-F: update an existing file.
-L displays the files contained in the compressed file.
The-p parameter is similar to the-c parameter. the decompressed result is displayed on the screen, but no conversion is performed.
-T check whether the compressed file is correct.
The-u parameter is similar to the-f parameter, but in addition to updating existing files, other files in the compressed file are also extracted to the directory.
-V displays detailed information when executing the command.
-Z only displays the remarks of the compressed file.
-A performs necessary character conversion on text files.
-B. do not convert characters in text files.
-C: The file name in the compressed file is case sensitive.
-J does not process the original directory path of the compressed file.
-L change all file names in the compressed file to lowercase letters.
-M sends the output result to the more Program for processing.
-N do not overwrite the original file during decompression.
-O does not need to ask the user first. after unzip is executed, it overwrites the original file.
-P <密码> Use the zip password option.
-No information is displayed when q is executed.
-S converts the white space characters in the file name to the bottom line characters.
-V retains the file version information of VMS.
-X: saves the original UID/GID of the file at the same time during decompression.
. ZIP file] specifies the. zip compressed file.
[File] specifies the files in the. zip compressed file to be processed.
-D <目录> Specifies the directory to be stored after the file is decompressed.
-X <文件> Specifies which files in the. zip compressed file are not processed.
-Z unzip-Z is equivalent to executing the zipinfo command.

Example:

Decompress/home/Blinux/html.zip to the current directory.

Unzip html.zip
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.