Example usage of Linux compression file command zip

Example usage of Linux compression file command zip

The ".zip" format is used to compress files on Windows systems. In fact, the ".zip" format file is a common compressed file type for both Windows and Linux systems. It is one of several mainstream compression formats (zip, rar, etc.). It is a fairly simple storage format that compresses each file separately.

Usage of Linux compression file command zip

zip [options] compressed package name source file or source directory list

Options:

Options meaning
-r Recursively compress the directory and all files and subdirectories under the specified directory.
-m After compressing the file, deleting the original file is equivalent to moving the file into the compressed file.
-v Displays detailed information about the compression process.
-q The execution process of the command is not displayed during compression.
-Compression level The compression level is a number from 1 to 9, where -1 means faster compression and -9 means better compression.
-u Update a compressed file, that is, add new files to the compressed file.

Example 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. Compress folders

zip -r dir1.zip dir1

The above is the detailed usage of the Linux compression file command zip. Thank you for your learning and support for 123WORDPRESS.COM.

You may also be interested in:
  • Analysis of the method of uploading zip compressed packages under Windows to Linux system using compression
  • How to decompress multiple files using the unzip command in Linux
  • Detailed explanation of zip compression and unzip decompression commands and their usage in Linux
  • How to install PHP extension zip and zlib on Linux server
  • gzip command in linux
  • Linux zip/unzip command detailed explanation

<<:  MySQL 5.7.24 compressed package installation and configuration method graphic tutorial

>>:  Detailed explanation of the function and usage of keepAlive component in Vue

Recommend

Implementation of running SQL Server using Docker

Now .net core is cross-platform, and everyone is ...

How to write HTML head in mobile device web development

Copy code The code is as follows: <head> &l...

The principle and application of MySQL connection query

Overview One of the most powerful features of MyS...

Detailed Example of CSS3 box-shadow Property

CSS3 -- Adding shadows (using box shadows) CSS3 -...

MySQL restores data through binlog

Table of contents mysql log files binlog Binlog l...

What knowledge systems do web designers need?

Product designers face complex and large manufactu...

Web Design Tutorial (7): Improving Web Design Efficiency

<br />Previous article: Web Design Tutorial ...

Detailed explanation of the difference between CSS link and @import

How to add css in html? There are three ways to s...

mysql group_concat method example to write group fields into one row

This article uses an example to describe how to u...

...

The whole process of installing gogs with pagoda panel and docker

Table of contents 1 Install Docker in Baota Softw...

HTML Tutorial: Unordered List

<br />Original text: http://andymao.com/andy...

CentOS 7 switching boot kernel and switching boot mode explanation

centos7 switch boot kernel Note: If necessary, it...