gzip is a command often used in Linux systems to compress and decompress files. The new file compressed by this command is usually marked with the extension ".gz". Let me emphasize again that the gzip command can only be used to compress files, not directories. Even if a directory is specified, only all files in the directory can be compressed. The basic format of the gzip command is as follows: [root@localhost ~]# gzip [options] source file The source file in the command refers to a common file when performing a compression operation, and refers to a compressed file when performing a decompression operation. The commonly used options and their meanings of this command are shown in Table 1. Table 1 Common options and meanings of the gzip command
【Example 1】Basic compression The gzip compression command is very simple. You don’t even need to specify the name of the compressed package. You only need to specify the source file name. Let's try it:
【Example 2】Keep source file compression When you compress a file using the gzip command, the source file disappears, resulting in a compressed file. At this time, some people will have obsessive-compulsive disorder and ask the author: Is it possible to prevent the source file from disappearing when compressing the file? Well, it's possible, but it's awkward.
【Example 3】 Compress directory We might take it for granted that the gzip command can compress directories. Let's try it:
In Linux, packaging and compression are handled separately. The gzip command can only compress but not package, so there will be no package directory, and only the files in the directory will be compressed. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How does MySQL implement ACID transactions?
>>: Encapsulation method of Vue breadcrumbs component
Every visit will generate Cookie in the browser, ...
Table of contents Preface start A little thought ...
Declare the parameter name, type and permission y...
This article uses an example to describe how to i...
This article describes how to use MySQL to export...
Table of contents 1. Joint index description 2. C...
I believe everyone knows HTML and CSS, knows the ...
Official website address: https://www.mysql.com/ ...
Nginx reverse proxy multiple servers, which means...
Table of contents 1. Introduction 2. Configure My...
This article mainly introduces the deployment of ...
Table of contents 1. MySQL data backup 1.1, mysql...
By default, the width and height of the header ar...
The first and most important step is how to insta...
Nowadays, application development is basically se...