Linux zip command details how to use Linux zip command

Source: Internet
Author: User
Tags zip

Zip is a widely used compression program. After files are compressed, other compressed files with the ". zip" extension will be generated.

Syntax

Zip [-AcdDfFghjJKlLmoqrSTuvVwXyz $] [-B <working Directory>] [-ll] [-n <character string>] [-t <date and time>] [-<compression efficiency>] [compressed file] [file...] [-I <Template style>] [-x <Template style>]

Parameters:

  • -A: adjust the executable automatic decompression file.
  • -B <working Directory> specifies the directory for temporarily storing files.
  • -C adds comments to each compressed file.
  • -D. Delete the specified file from the compressed file.
  • -D. The directory name is not created in the compressed file.
  • -F this parameter works similarly to the specified "-u" parameter, but not only updates existing files, if some files do not exist in the compressed file, this parameter is used to add it to the compressed file.
  • -F tries to repair damaged compressed files.
  • -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> only compresses files that meet the conditions.
  • -J only saves the file name and its content, without storing any directory name.
  • -J: delete unnecessary data before the compressed file.
  • -K uses a file name in MS-DOS-compatible format.
  • -L replace the LF character with the LF + CR character when compressing the file.
  • -Replace the LF + CR character with the LF character when compressing the file.
  • -L displays the copyright information.
  • -M: After compressing the file and adding it to the compressed file, delete the original file, that is, move the file to the compressed file.
  • -N <character string> does not compress files with specific character strings.
  • -O the file with the latest change time in the compressed file is used as the standard, and the change time of the compressed file is set to the same as that of the file.
  • -Q: The command execution process is not displayed.
  • -R recursive processing: All files and subdirectories in the specified directory are processed together.
  • -S contains the system and hidden files.
  • -T <date and time> sets the date of the compressed file to the specified date.
  • -T check whether each file in the backup file is correct.
  • -U replace the newer file into the compressed file.
  • -V displays the command execution process or version information.
  • -V stores the file attributes of the VMS operating system.
  • -W indicates the version number in the file name. This parameter is only valid in the VMS operating system.
  • -X <Template style> files that meet the condition are excluded during compression.
  • -X does not save additional file attributes.
  • -Y directly saves the symbolic connection, not the file pointed to by the connection. This parameter is only valid in UNIX and other systems.
  • -Z adds comments to the compressed file.
  • -$ Name of the volume on which the first compressed file is stored.
  • -<Compression efficiency> The compression efficiency is a value ranging from 1 to 9.

Instance

Compressed file

# Zip-v cp.zip. c B. c. c e. c adding:. c (in = 0) (out = 0) (stored 0%) adding: B. c (in = 0) (out = 0) (stored 0%) adding: c. c (in = 0) (out = 0) (stored 0%) adding: e. c (in = 0) (out = 0) (stored 0%) total bytes = 0, compressed = 0-> 0% savings

Compressed file

# [Root @ ubuntu a] # zip-v cp2.zip *#

Compressed Directory

# Zip-r cp3.zip/root/

Delete a file from a compressed file

# Zip-dv cp.zip a. c

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.