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
Vue - implement the shuttle box function, the eff...
Commonly used JavaScript code to detect which ver...
Regarding display: flex layout, some people have ...
First and foremost, I am a web designer. To be mor...
Often, we may need to export local database data ...
This article shares the specific code for JavaScr...
ReactRouter implementation ReactRouter is the cor...
I used js to create a package for converting Chin...
This article example shares the specific code of ...
As shown below: nsenter -t 1 -m -u -n -i sh -c &q...
Preface Take Element Plus as an example to config...
Table of contents Overview definition Instance Me...
Rich text editors are often used when doing backg...
I encountered this problem before when developing...
Table of contents K8S Advanced Features Advanced ...