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

Docker installs ClickHouse and initializes data testing

Clickhouse Introduction ClickHouse is a column-or...

Web form creation skills

In fact, the three tables above all have three ro...

Markup language - CSS layout

Click here to return to the 123WORDPRESS.COM HTML ...

A simple way to implement Vue's drag screenshot function

Drag the mouse to take a screenshot of the page (...

Installation and configuration of mysql 8.0.15 under Centos7

This article shares with you the installation and...

Deploy Nginx+Flask+Mongo application using Docker

Nginx is used as the server, Mongo is used as the...

MYSQL database GTID realizes master-slave replication (super convenient)

1. Add Maria source vi /etc/yum.repos.d/MariaDB.r...

Vue Element front-end application development: Use of API Store View in Vuex

Table of contents Overview 1. Separation of front...

Implementation of master-slave replication in docker compose deployment

Table of contents Configuration parsing Service C...

How to isolate users in docker containers

In the previous article "Understanding UID a...

How to prevent hyperlink redirection using JavaScript (multiple ways of writing)

Through JavaScript, we can prevent hyperlinks fro...

A problem with MySQL 5.5 deployment

MySQL deployment Currently, the company deploys M...