Editing Xz

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
 
<code>[[wikipedia:XZ_Utils|xz utils]]</code><ref>https://man.cx/xz</ref> (previously [[LZMA]] Utils) [[compress]] or decompress (<code>[[unxz]]</code>) <code>.xz</code> and <code>.lzma</code> files but xz compresses by default to xz format.
 
<code>[[wikipedia:XZ_Utils|xz utils]]</code><ref>https://man.cx/xz</ref> (previously [[LZMA]] Utils) [[compress]] or decompress (<code>[[unxz]]</code>) <code>.xz</code> and <code>.lzma</code> files but xz compresses by default to xz format.
 
* <code>[[brew install xz]]</code>
 
  
 
xz support multi-threaded compression (<code>-T</code> flag)<ref>https://man.cx/xz</ref> since 2014, version 5.2.0. <ref>https://git.tukaani.org/?p=xz.git;a=blob;f=NEWS;hb=HEAD</ref>, as of 2019 threaded decompression hasn’t been implemented yet. <ref>https://man.cx/xz</ref>. Number of threads can be less that defined is file is not big enough for threading with the given settings or if using more threads would exceed the memory usage limit. <ref>https://man.cx/xz</ref>
 
xz support multi-threaded compression (<code>-T</code> flag)<ref>https://man.cx/xz</ref> since 2014, version 5.2.0. <ref>https://git.tukaani.org/?p=xz.git;a=blob;f=NEWS;hb=HEAD</ref>, as of 2019 threaded decompression hasn’t been implemented yet. <ref>https://man.cx/xz</ref>. Number of threads can be less that defined is file is not big enough for threading with the given settings or if using more threads would exceed the memory usage limit. <ref>https://man.cx/xz</ref>
Line 11: Line 9:
 
:<code>[[--keep]]</code> Once the target file has been successfully closed, the source file is removed unless --keep was specified
 
:<code>[[--keep]]</code> Once the target file has been successfully closed, the source file is removed unless --keep was specified
 
:<code>[[-T]]</code> [[multi-threaded]] compression
 
:<code>[[-T]]</code> [[multi-threaded]] compression
:<code>[[xz --help]]</code>
 
  
 
== Commands ==
 
== Commands ==
 
* <code>[[xz -t]] file_to_test.xz</code>
 
* <code>[[xz -t]] file_to_test.xz</code>
 
* <code>[[xz -q]]</code>
 
* <code>[[xz -q]]</code>
* <code>[[xz -T]]</code>
 
* <code>[[xz -T0]]</code>
 
* <code>[[xz -9 file_to_compress]]</code>
 
 
* <code>xz --info-memory</code>
 
* <code>xz --info-memory</code>
 
<pre>
 
<pre>
Line 28: Line 22:
  
 
* Use <code>--verbose</code> option twice to get extra information about compression, such us number of threads to use or memory required. It can impact xz performance.
 
* Use <code>--verbose</code> option twice to get extra information about compression, such us number of threads to use or memory required. It can impact xz performance.
<code>xz [[-T0]] --verbose --verbose file_to_compress</code>
+
<code>xz -T0 --verbose --verbose file_to_compress</code>
 
<pre>
 
<pre>
 
xz: Filter chain: --lzma2=dict=8MiB,lc=3,lp=0,pb=2,mode=normal,nice=64,mf=bt4,depth=0
 
xz: Filter chain: --lzma2=dict=8MiB,lc=3,lp=0,pb=2,mode=normal,nice=64,mf=bt4,depth=0
Line 48: Line 42:
  
 
== Examples ==
 
== Examples ==
* Test integrity: <code>[[xz -t]]v linux-3.18.19.tar.xz</code>
+
* Test integrity:<code>xz -tv linux-3.18.19.tar.xz</code>
 
* Compress data from <code>[[stdin]]</code>: <code>echo "DATA TO COMPRESS" | xz --verbose > file.xz</code>
 
* Compress data from <code>[[stdin]]</code>: <code>echo "DATA TO COMPRESS" | xz --verbose > file.xz</code>
 
* Compress all files in directory and subdirectory except already compresed (<code>.xz</code>) using all CPUs (<code>-T0</code>):
 
* Compress all files in directory and subdirectory except already compresed (<code>.xz</code>) using all CPUs (<code>-T0</code>):
Line 55: Line 49:
 
   xz file.txt
 
   xz file.txt
 
   xz: file.txt.xz: File exists
 
   xz: file.txt.xz: File exists
 
== Security ==
 
* [[CVE-2024-3094 Backdoor in xz]]
 
  
 
== Activities ==
 
== Activities ==
Line 65: Line 56:
 
# Compress your file with <code>xz -T0</code> and verify that you are using all your [[threads]] with [[htop]]
 
# Compress your file with <code>xz -T0</code> and verify that you are using all your [[threads]] with [[htop]]
  
== Related ==
+
== Related commands ==
 
* <code>[[tar -J]]</code>
 
* <code>[[tar -J]]</code>
 
* <code>[[zstd]]</code>
 
* <code>[[zstd]]</code>
Line 71: Line 62:
  
 
== See also ==
 
== See also ==
* {{xz}}
 
* {{zstd}}
 
 
* {{Data compression}}
 
* {{Data compression}}
 +
* <code>[[zstd]]</code><ref>https://en.wikipedia.org/wiki/Zstandard</ref> compression utility released in 2015 which includes parallel (multi-threaded) implementations of both compression and decompression
 +
* {{cp}}
 +
* {{du}}
 
* [[Intel QAT]] (QuickAssist Technology): https://software.intel.com/en-us/articles/how-intel-quickassist-technology-accelerates-nfv-use-cases
 
* [[Intel QAT]] (QuickAssist Technology): https://software.intel.com/en-us/articles/how-intel-quickassist-technology-accelerates-nfv-use-cases
  
 
[[Category:compression]]
 
[[Category:compression]]

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: