Get the App
SLTechnology News&Howtos  ›  Servers  › 

The example usage of the linux compressed file command zip

Shulou Source: shulou.com Published: 2022-06-02 04:34:12 10月04日 Update

".zip" format is used to compress files on Windows systems. In fact, ".zip" format files are commonly used in both Windows and Linux systems. They belong to one of several mainstream compression formats (zip, rar, etc.). It is a fairly simple storage format for compressing each file separately.

The usage of the linux compressed file command zip

Zip [options] compress the package name source file or source directory list

Options:

The meaning of the option-r recursively compresses the directory and compresses all files and subdirectories under the specified directory. -m after compressing the file, deleting the original file is equivalent to moving the file to the compressed file. -v displays detailed compression process information. -Q does not show the execution of the command during compression. -Compression level is a number from 1 to 9,-1 means faster compression, and-9 means better compression. -u update the compressed file, that is, add a new file to the compressed file.

Examples of use:

1. Compress a single file

Zip ana.zip anaconda-ks.cfg

2. Compress multiple files

Zip test.zip install.log install.log.syslog

3. Compressed folder

Zip-r dir1.zip dir1

These are the details of the usage of the linux compressed file command zip. Thank you for your study and support.

Tags: Files formats commands representatives directories systems levels procedures original mainstream information content single meaning multiple subcategories subdirectories that is effects numbers Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi OPPO Reno NVidia MySQL Linux