{"id":3848,"date":"2019-07-16T11:57:31","date_gmt":"2019-07-16T03:57:31","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=3848"},"modified":"2019-07-27T00:01:24","modified_gmt":"2019-07-26T16:01:24","slug":"xz","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/xz","title":{"rendered":"xz\u547d\u4ee4 – POSIX \u5e73\u53f0\u5f00\u53d1\u5de5\u5177"},"content":{"rendered":"\n
XZ Utils \u662f\u4e3a POSIX \u5e73\u53f0\u5f00\u53d1\u5177\u6709\u9ad8\u538b\u7f29\u7387\u7684\u5de5\u5177\u3002\u5b83\u4f7f\u7528 LZMA2 \u538b\u7f29\u7b97\u6cd5\uff0c\u751f\u6210\u7684\u538b\u7f29\u6587\u4ef6\u6bd4 POSIX \u5e73\u53f0\u4f20\u7edf\u4f7f\u7528\u7684 gzip\u3001bzip2 \u751f\u6210\u7684\u538b\u7f29\u6587\u4ef6\u66f4\u5c0f\uff0c\u800c\u4e14\u89e3\u538b\u7f29\u901f\u5ea6\u4e5f\u5f88\u5feb\u3002<\/p>\n\n\n\n
\u6700\u521d XZ Utils \u7684\u662f\u57fa\u4e8e LZMA-SDK \u5f00\u53d1\uff0c\u4f46\u662f LZMA-SDK \u5305\u542b\u4e86\u4e00\u4e9b WINDOWS \u5e73\u53f0\u7684\u7279\u6027\uff0c\u6240\u4ee5 XZ Utils \u4e3a\u4ee5\u9002\u5e94 POSIX \u5e73\u53f0\u4f5c\u4e86\u5927\u5e45\u7684\u4fee\u6539\u3002XZ Utils \u7684\u51fa\u73b0\u4e5f\u662f\u4e3a\u4e86\u53d6\u4ee3 POSIX \u7cfb\u7edf\u4e2d\u65e7\u7684 LZMA Utils\u3002<\/p>\n\n\n\n
\u8bed\u6cd5\u683c\u5f0f\uff1a <\/strong>xz [\u53c2\u6570]<\/p>\n\n\n\n \u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n \u53c2\u8003\u5b9e\u4f8b<\/strong> <\/p>\n\n\n\n \u538b\u7f29\u4e00\u4e2a\u6587\u4ef6 test.txt\uff0c\u538b\u7f29\u6210\u529f\u540e\u751f\u6210 test.txt.xz, \u539f\u6587\u4ef6\u4f1a\u88ab\u5220\u9664\uff1a<\/p>\n\n\n\n \u89e3\u538b test.txt.xz \u6587\u4ef6\uff0c\u5e76\u4f7f\u7528\u53c2\u6570 -k \u4fdd\u6301\u539f\u6587\u4ef6\u4e0d\u88ab\u5220\u9664\uff1a<\/p>\n\n\n\n \u53c2\u6570 -H \u6bd4\u4f7f\u7528\u53c2\u6570 --help \u663e\u793a\u7684\u5185\u5bb9\u66f4\u8be6\u7ec6\uff1a<\/p>\n\n\n\n \u501f\u52a9 xargs \u547d\u4ee4\u5e76\u884c\u538b\u7f29\u591a\u6587\u4ef6\uff1a<\/p>\n\n\n\n <\/p>\n","protected":false},"excerpt":{"rendered":" XZ Utils \u662f\u4e3a POSIX \u5e73\u53f0\u5f00\u53d1\u5177\u6709\u9ad8\u538b\u7f29\u7387\u7684\u5de5\u5177\u3002\u5b83\u4f7f\u7528 LZMA2 \u538b\u7f29\u7b97\u6cd5\uff0c\u751f\u6210\u7684\u538b\u7f29\u6587\u4ef6\u6bd4 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3848"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=3848"}],"version-history":[{"count":3,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3848\/revisions"}],"predecessor-version":[{"id":4337,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3848\/revisions\/4337"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=3848"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=3848"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=3848"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}z, --compress <\/td> \u5f3a\u5236\u538b\u7f29 <\/td><\/tr> -t, --test<\/td> \u6d4b\u8bd5\u538b\u7f29\u6587\u4ef6\u7684\u5b8c\u6574\u6027<\/td><\/tr> -l, --list<\/td> \u5217\u51fa\u6709\u5173.xz\u6587\u4ef6\u7684\u4fe1\u606f<\/td><\/tr> -k, --keep<\/td> \u4fdd\u7559\uff08\u4e0d\u8981\u5220\u9664\uff09\u8f93\u5165\u6587\u4ef6<\/td><\/tr> -f, --force<\/td> \u5f3a\u5236\u8986\u76d6\u8f93\u51fa\u6587\u4ef6\u548c\uff08\u89e3\uff09\u538b\u7f29\u94fe\u63a5<\/td><\/tr> -c, --stdout, --to-stdout<\/td> \u5199\u5165\u6807\u51c6\u8f93\u51fa\uff0c\u4e0d\u8981\u5220\u9664\u8f93\u5165\u6587\u4ef6<\/td><\/tr> -0 \u2026 -9<\/td> \u538b\u7f29\u9884\u8bbe; \u9ed8\u8ba4\u4e3a6; \u53d6\u538b\u7f29\u673a\u548c
\u4f7f\u75287-9\u4e4b\u524d\u89e3\u538b\u7f29\u5185\u5b58\u4f7f\u7528\u91cf\u8003\u8651\u5728\u5185\uff01<\/td><\/tr>-e, --extreme<\/td> \u5c1d\u8bd5\u901a\u8fc7\u4f7f\u7528\u66f4\u591a\u7684CPU\u65f6\u95f4\u6765\u63d0\u9ad8\u538b\u7f29\u6bd4<\/td><\/tr> -T, --threads=NUM<\/td> \u6700\u591a\u4f7f\u7528NUM\u4e2a\u7ebf\u7a0b; \u9ed8\u8ba4\u503c\u4e3a1<\/td><\/tr> set to 0<\/td> \u8bbe\u7f6e\u4e3a0\uff0c\u4f7f\u7528\u4e0e\u5904\u7406\u5668\u5185\u6838\u4e00\u6837\u591a\u7684\u7ebf\u7a0b<\/td><\/tr> -q, --quiet<\/td> \u6291\u5236\u8b66\u544a; \u6307\u5b9a\u4e24\u6b21\u4ee5\u6291\u5236\u9519\u8bef<\/td><\/tr> -v, --verbose <\/td> \u5197\u957f; \u6307\u5b9a\u4e24\u6b21\u66f4\u8be6\u7ec6<\/td><\/tr> -h, --help<\/td> \u663e\u793a\u8fd9\u4e2a\u7b80\u6d01\u7684\u5e2e\u52a9\u5e76\u9000\u51fa<\/td><\/tr> -H, --long-help <\/td> \u663e\u793a\u66f4\u591a\u5e2e\u52a9\uff08\u8fd8\u5217\u51fa\u4e86\u9ad8\u7ea7\u9009\u9879\uff09<\/td><\/tr> -V, --version <\/td> \u663e\u793a\u7248\u672c\u53f7\u5e76\u9000\u51fa<\/td><\/tr><\/tbody><\/table>\n\n\n\n [root@linuxcool ~]$ xz test.txt\n[root@linuxcool ~]$ ls test.txt*\ntest.txt.xz<\/pre>\n\n\n\n
[root@linuxcool ~]$ xz -d -k test.txt.xz\n[root@linuxcool ~]$ ls test.txt*\ntest.txt.xz test.txt<\/pre>\n\n\n\n
[root@linuxcool ~]$ xz -H | more<\/pre>\n\n\n\n
[root@linuxcool ~]find \/var\/log -type f -iname \"*.log\" -print0 | xargs -P4 -n16 xz -T1<\/pre>\n\n\n\n