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
Repetition: Repeat certain page design styles thr...
html,address, blockquote, body,dd,div, dl,dt,fiel...
The project has been suspended recently, and the ...
If MySQL version 5.0 already exists on the machin...
By default, the width and height of the cell are ...
Experimental environment: 1. Three CentOS 7 serve...
In the process of team development, it is essenti...
This article mainly explains how to use clearfix a...
In fact, we have been hearing a lot about web des...
Preface This article mainly introduces the analys...
In HTML, the <img> tag is used to define an...
This article uses an example to describe the simp...
Since I found that the push image always timed ou...
Common Nginx configuration allows cross-domain se...
Preface Last week, a colleague asked me: "Br...