Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use gzip Compression Command

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you how to use the gzip compression command, I hope you will learn a lot after reading this article, let's discuss it together!

How to use the gzip compression command: [gzip [options] source file], such as [gzip install.log]. Gzip is a command that is often used to compress and decompress files in linux systems.

Gzip is a command that is often used to compress and decompress files in Linux systems. New files are compressed by this command, and the extension is usually marked ".gz".

Video tutorial recommendation: linux video tutorial

The basic format of the gzip command is as follows:

[root@localhost ~] # gzip [options] source file

Basic compression

The gzip compression command is so simple that you don't even need to specify the compressed package name, just the source file name. Let's try this:

[root@localhost ~] # gzip install.log# compressed instal.log file [root@localhost ~] # lsanaconda-ks.cfg install.log.gz install.log.syslog# compressed file is generated, but the source file also disappears

Preserve 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, forced to ask the author: can not let the source file disappear when compressing the file? Well, that's okay, but it's awkward.

[root@localhost ~] # gzip-c anaconda-ks.cfg > anaconda-ks.cfg.gz# uses the-c option, but instead of exporting compressed data to the screen, it is redirected to a compressed file, so that the file can be shrunk without deleting the source file [root@localhost ~] # lsanaconda-ks.cfg anaconda-ks.cfg.gz install.log.gz install.log.syslog#. You can see that both the compressed file and the source file exist after reading this article. I believe you have a certain understanding of the use of the gzip compression command, want to know more related knowledge, welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report