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
In MySQL, there is a function called "group_...
This article example shares the specific code of ...
CUDA installation download cuda Enter the nvidia-...
This article example shares the specific code of ...
Preface In WEB development, we often involve cros...
Nowadays, cross-platform development technology i...
Index extension: InnoDB automatically extends eac...
Table of contents MySQL's current_timestamp p...
Introduction to Flex Layout Flex in English means...
Table of contents 1. What kind of backup is a dat...
Table of contents 1. Select All 2. Increase or de...
Many friends who have just started to make web pag...
Here is a text hovering and jumping effect implem...
html4: Copy code The code is as follows: <form...
Table of contents What is JSON Why this technolog...