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

Using linux's xz commands POSIX platform development tools

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Do not know how to use linux xz commands POSIX platform development tools? In fact, it is not difficult to solve this problem. Let the editor take you to learn how to solve it. I hope you will gain a lot after reading this article.

XZ Utils is a tool with high compression ratio developed for the POSIX platform. It uses the LZMA2 compression algorithm to generate compressed files that are smaller than those generated by gzip and bzip2, which are traditionally used on the POSIX platform, and the decompression speed is also very fast.

XZ Utils was originally developed based on LZMA-SDK, but LZMA-SDK contains some features of the WINDOWS platform, so XZ Utils has made significant changes to adapt to the POSIX platform. XZ Utils also appeared to replace the old LZMA Utils in POSIX system.

Syntax format: xz [parameters]

Common parameters:

Z,-- compress forced compression-t,-- test tests the integrity of compressed files-l,-- list lists information about .xz files-- k,-- keep retains (do not delete) input files-f,-- force forces overwrite output files and (unzip) links-c,-- stdout,-- to-stdout writes standard output, do not delete input files-0... -9 compression preset; default is 6; take compressor and

Decompress memory usage before using 7-9, taking into account! -e,-- extreme attempts to improve compression ratio-T by using more CPU time,-- threads=NUM uses up to NUM threads; default value is 1set to 0 set to 0, using as many threads as processor kernel-Q,-- quiet suppresses warnings; specify twice to suppress error-v,-- verbose verbosity Specify twice for more detail-h,-help displays this concise help and exits-H,-long-help displays more help (advanced options are also listed)-V,-- version displays the version number and exits

Reference example

Compress a file test.txt. After the compression is successful, the test.txt.xz is generated, and the original file will be deleted:

[root@linuxcool ~] $xz test.txt [root@linuxcool ~] $ls test.txt*test.txt.xz

Extract the test.txt.xz file and use the parameter-k to keep the original file from being deleted:

[root@linuxcool] $xz-d-k test.txt.xz [root@linuxcool ~] $ls test.txt*test.txt.xz test.txt

The parameter-H is displayed in more detail than using the parameter-- help:

[root@linuxcool ~] $xz-H | more

Compress multiple files in parallel with the xargs command:

[root@linuxcool] find / var/log-type f-iname "* .log"-print0 | xargs-P4-n16 xz-T1 Thank you for reading this article carefully. I hope it is helpful for the editor to share the POSIX platform development tools using linux's xz commands. At the same time, I also hope that you will support us, pay attention to the industry information channel, and find a detailed solution waiting for you to learn!

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