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 the compress command of Linux

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Editor to share with you how to use the compress command of Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

The Linux common command compress uses "Lempress-Ziv" encoding to compress data files. Compress is a long history of compression program, after the file is compressed, its name will be followed by the extension ".Z".

Compress uses Lempress-Ziv encoding to compress data files

Add that when you want to decompress, you can execute the uncompress instruction. In fact, uncompress is a symbolic link to compress, so whether it is compressed or decompressed, it can be done separately through the compress instruction.

Syntax compress (option) (parameter) option-f: do not prompt the user to force the target file to be overwritten;-c: send the result to standard output, no file has been changed;-r: recursive operation;-b: compression efficiency is a value between 916 and the default value is "16". The higher the specified value, the higher the compression efficiency;-d: decompress the file instead of compressing it. -v: displays the instruction execution process;-V: displays the instruction version and program preset values. Parameter file: specifies the list of files to compress.

Instance restores / etc/man.config to / tmp and compresses it

[root@localhost ~] # cd / tmp [root@localhost tmp] # cp / etc/man.config. [root@localhost tmp] # compress man.config [root@localhost tmp] # ls-l-rw-r--r-- 1 root root 2605 Jul 27 11:43 man.config.Z unlock the compressed file you just had

[root@localhost tmp] # compress-d man.config.Z compresses man.config into another file for backup

[root@localhost tmp] # compress-c man.config > man.config.back.Z [root@localhost tmp] # ll man.config*-rw-r--r-- 1 root root 4506 Jul 27 11:43 man.config-rw-r--r-- 1 root root 2605 Jul 27 11:46 man.config.back.Z this-c option is more interesting! The data of the compression process is output to the screen instead of being written as a file.Z file. Therefore, we can export the data to another file name by redirecting the data stream.

The above is all the contents of the article "how to use Linux's compress commands". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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

Development

Wechat

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

12
Report