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
Table of contents Cycle comparison usage Summariz...
This article example shares the specific code of ...
Table of contents Packaging, launching and optimi...
Table of contents Preface vue.config.js configura...
1) Enter the folder path where the jdk file is st...
The insignificant flex-basis has caused a lot of ...
Seamless carousel is a very common effect, and it...
Preface: As a junior programmer, I dream of build...
Cell -- the content of the table Cell margin (tabl...
MySQL is a multi-user managed database that can a...
MySQL string concatenation, interception, replace...
This tutorial shares the installation tutorial of...
There was an article about the execution process ...
What is ELK? ELK is a complete set of log collect...
I'll record the problems I encountered during...