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

About ROS2 installation and docker environment usage

Table of contents Why use Docker? Docker installa...

Shell script settings to prevent brute force ssh

The shell script sets access control, and the IP ...

Summary of the differences between MySQL storage engines MyISAM and InnoDB

1. Changes in MySQL's default storage engine ...

Paragraph layout and line breaks in HTML web pages

The appearance of a web page depends largely on i...

How to call a piece of HTML code together on multiple HTML pages

Method 1: Use script method: Create a common head...

Xhtml special characters collection

nbsp &#160; no-break space = non-breaking spa...

Start nginxssl configuration based on docker

Prerequisites A cloud server (centOS of Alibaba C...

CSS horizontal progress bar and vertical progress bar implementation code

Sometimes it’s nice to see some nice scroll bar e...

MySQL full backup and quick recovery methods

A simple MySQL full backup script that backs up t...

Detailed explanation of WeChat Mini Program official face verification

The mini program collected user personal informat...

How to redirect PC address to mobile address in Vue

Requirements: The PC side and the mobile side are...

How to run sudo command without entering password in Linux

The sudo command allows a trusted user to run a p...

Analysis of idea compiler vue indentation error problem scenario

Project scenario: When running the Vue project, t...

Linux Check the installation location of the software simple method

1. Check the software installation path: There is...