A cikin labarin na gaba zamuyi amfani da amfani mai matsi na xz. Wani abokin aiki ya riga ya gaya mana game da ita wani lokaci da suka gabata a cikin labarin game da yadda za a zina da kuma cire fayilolin a cikin Ubuntu. Amfani da wannan kayan aikin yayi kama da gzip da bzip2.
Za a iya amfani da shi don damfara ko decompress fayiloli gwargwadon yanayin aikin da aka zaɓa. Hanyar matsewa da waɗannan fayilolin suke amfani da ita shine dangane da algorithm na LZMA/ LZMA2. An fara kirkirar wannan algorithm a ƙarshen shekarun 90. Yana amfani da makircin ƙamus na ƙamus kamar LZ77.
LZ77 algorithm na matsawa na dangi ne asarar compresres, wanda aka fi sani da compres compresres. An san su da wannan sunan ne saboda basa barin bayanai daga cikin fayil din yayin matse shi. Sabanin compresres masu amfani da algorithms na nau'in asara. Wadannan suna barin wasu bayanan da ke neman rage girman fayil na asali da yawa. Misalin wannan zai zama jpeg, MP3, MPG, da sauransu.
Idan aka kwatanta da fayilolin "gz", "xz" yana da rabo mafi kyau na matsi da gajeren lokacin lalacewa. Koyaya, lokacin da muke amfani da saitunan matsi na tsoho, zai buƙaci ƙarin ƙwaƙwalwa don raguwa. Gzip yana da ɗan ƙananan amfani da ƙwaƙwalwar ajiya.
Ana amfani da fayilolin .xz don damfara da nakasa bayanai, don haka canja wurin fayiloli ta Intanet ko adana bayanai a kan rumbun kwamfutar ya zama ƙasa. A ƙarshe, idan muna so matse fayil din da yake neman zama a matsayin dan karamin wuri, muna da zaɓi don damfara shi da xz.
Yadda ake amfani da matsewar XZ
Compress
El misali mafi sauki matsawa fayil tare da xz kamar haka. A cikin m (Ctrl + Alt T) mun rubuta:
xz android-x86_64-7.1-r2.iso
Hakanan zaka iya amfani da -z zaɓi don yin matsawa:
xz -z android-x86_64-7.1-r2.iso
Waɗannan dokokin za su damfara fayil ɗin, amma za su share fayil ɗin tushe. Ee ba mu neman share fayilolin tushe, za mu yi amfani da -k zaɓi mai bi:
xz -k android-x86_64-7.1-r2.iso
Decompress
Don rage fayil, zamu iya amfani da -d zaɓi:
xz -d android-x86_64-7.1-r2.iso
Hakanan zamu iya cimma nasara iri ɗaya tare da zaɓi unxz:
unxz android-x86_64-7.1-r2.iso
Comparfafa ƙarfi
Idan aiki ya gaza, misali idan akwai fayil ɗinda aka matse tare da suna iri ɗaya, za mu yi amfani da shi -f zaɓi don tilasta aiwatar:
xz -kf android-x86_64-7.1-r2.iso
Kafa matakan matsi
Wannan kayan aikin yana tallafawa matakan saiti daban-daban na matsi (0 zuwa 9. Tare da darajar tsoho na 6). Hakanan zamu iya yi amfani da laƙabi as-azumi (zai zama da sauri, amma tare da rage matsi) don saita matsayin ƙimar 0 da –best don saita matsayin ƙimar 9 (jinkirin amma matsawa mafi girma). Wasu misalan yadda za'a saita waɗannan matakan sune masu zuwa:
xz -k -8 android-x86_64-7.1-r2.iso xz -k --best android-x86_64-7.1-r2.iso
Iyakance ƙwaƙwalwar ajiya
Idan muna da amountan ƙananan memorywa memorywalwar ajiya da son matse babbar fayil, zamu sami damar amfani da -memory option = iyaka (limitimar iyaka tana iya kasancewa cikin MB ko a matsayin adadin RAM) don saita iyakar amfani da ƙwaƙwalwar don matsawa:
xz -k --best --memlimit-compress=10% android-x86_64-7.1-r2.iso
Sanya yanayin shiru
Idan muna da sha'awar aiwatar da matsawa a cikin yanayin shiru, kawai zamu ƙara da -q zaɓi. Hakanan zamu iya ba da damar yanayin magana tare da -v, kamar yadda aka nuna a cikin masu zuwa:
xz -k -q android-x86_64-7.1-r2.iso xz -k -qv android-x86_64-7.1-r2.iso
Createirƙiri fayil na tar.xz
Mai zuwa misali ne na amfani don samun fayil tare da tsawo tar.xz.
tar -cf - *.txt | xz -7 > txtfiles.tar.xz
Don cimma wannan ƙarshen, zamu iya amfani da:
tar -cJf txtfiles.tar.xz *.txt
Duba mutuncin fayilolin matsawa
Zamu iya gwada mutuncin fayilolin matsewa ta amfani da -t zaɓi. Amfani -l zamu iya ganin bayanin game da fayil ɗin da aka matsa.
xz -t txtfiles.tar.xz xz -l txtfiles.tar.xz
Wannan kayan aiki ne mai kyau don damfara fayiloli. A cikin wannan labarin, kawai muna duban wasu misalai don damfara da raguwa. Don ƙarin bayani game da duk abin da za mu iya yi, za ka iya zuwa shafin mutum xz.