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

37 Tips for a Good User Interface Design (with Pictures)

1. Try to use single column instead of multi-colum...

Detailed steps to install mysql 8.0.18-winx64 on win10

1. First go to the official website to download t...

Execute the shell or program inside the Docker container on the host

In order to avoid repeatedly entering the Docker ...

React implements the sample code of Radio component

This article aims to use the clearest structure t...

Webpack builds scaffolding to package TypeScript code

Create a folder Directory structure: dabaots Init...

Summary of three ways to implement ranking in MySQL without using order by

Assuming business: View the salary information of...

A brief discussion on the use of Web Storage API

Table of contents 1. Browser local storage techno...

What is ssh port forwarding? What's the use?

Table of contents Preface 1. Local port forwardin...

Summary of 4 ways to add users to groups in Linux

Preface Linux groups are organizational units use...

Three ways to draw a heart shape with CSS

Below, we introduce three ways to draw heart shap...

How to start a transaction in MySQL

Preface This article mainly introduces how to sta...

Detailed explanation of MySQL EXPLAIN output columns

1. Introduction The EXPLAIN statement provides in...

MySQL/MariaDB Root Password Reset Tutorial

Preface Forgotten passwords are a problem we ofte...