{"id":114,"date":"2011-04-28T16:37:23","date_gmt":"2011-04-28T16:37:23","guid":{"rendered":"https:\/\/shan.info\/new\/linux-%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%e5%8e%8b%e7%bc%a9%e8%a7%a3%e5%8e%8b%e7%bc%a9\/"},"modified":"2011-04-28T16:37:23","modified_gmt":"2011-04-28T16:37:23","slug":"linux-%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%e5%8e%8b%e7%bc%a9%e8%a7%a3%e5%8e%8b%e7%bc%a9","status":"publish","type":"post","link":"https:\/\/shan.info\/new\/linux-%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%e5%8e%8b%e7%bc%a9%e8%a7%a3%e5%8e%8b%e7%bc%a9\/","title":{"rendered":"linux \u5e38\u7528\u547d\u4ee4\u538b\u7f29,\u89e3\u538b\u7f29"},"content":{"rendered":"<h2>\u5b9e\u4f8b\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tar -czf domain.tar Domain\/<\/h2>\n<h2>tar -czf Dossiers.tar Dossiers\/<\/h2>\n<p>\u00a0<\/p>\n<p>\u540e\u53f0\u8fd0\u884c<\/p>\n<h2>nohup tar -czf domain.tar Domain\/ &amp;<\/h2>\n<h2>nohup tar -czf Dossiers.tar Dossiers\/ &amp;<\/h2>\n<p>\u00a0<\/p>\n<h2>nohup tar -cf backup.tar Domain\/ Dossiers\/ logs\/ &amp;<\/h2>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p><span style=\"font-size: medium;\"><strong><span style=\"font-size: large;\">\u540d\u79f0 : tar<\/span> <\/strong><\/span> (The GNU version of the tar archiving utility)<br \/> <strong>\u4f7f\u7528\u6743\u9650 : <\/strong>\u6240\u6709\u4f7f\u7528\u8005<br \/> <strong>\u4f7f\u7528\u65b9\u5f0f :<\/strong> tar [-czxf] [NAME] [FILES\/DIRECTORIES]<br \/> <strong>\u8bf4\u660e : <\/strong>\u53ef\u4ee5\u5c06\u591a\u4e2a\u6587\u4ef6\u6216\u76ee\u5f55\u6253\u5305\u6210\u4e00\u4e2a\u6587\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u5c06\u6253\u5305\u6587\u4ef6\u6216\u538b\u7f29\u6587\u4ef6\u89e3\u5305\u6216\u89e3\u538b\u7f29\u3002\uff08tar\u539f\u672c\u53ea\u662f\u7528\u6765\u5c06\u591a\u4e2a\u6587\u4ef6\u6253\u5305\u6210\u4e00\u4e2a\u6587\u4ef6\u7684\uff0c\u4e0d\u5177\u5907\u538b\u7f29\u529f\u80fd\uff0c\u662f\u540e\u6765\u52a0\u5165\u4e86\u538b\u7f29\u529f\u80fd\u3002\uff09<\/p>\n<p> <strong>\u53c2\u6570 :<\/strong><br \/> -c \u6253\u5305\uff0c\u5373\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5305\u6587\u4ef6<br \/> -x \u89e3\u5305<br \/> -z \u538b\u7f29\u6216\u89e3\u538b\u7f29\uff08-cz\u540c\u65f6\u6253\u5305\u5e76\u538b\u7f29\uff09<br \/> -f\u00a0 \u6307\u5b9a\u5305\u6587\u4ef6\u7684\u6587\u4ef6\u540d<\/p>\n<p> <strong>\u8303\u4f8b\uff1a<\/strong><br \/> tar -cf myfile.tar test1 test2 test\/<br \/> \u5c06\u6587\u4ef6test1\u3001test2\u548c\u76ee\u5f55test\u4e00\u8d77\u6253\u5305\u6210myfile.tar<\/p>\n<p> tar -xf myfile.tar<br \/> \u5c06myfile.tar\u89e3\u5305\u81f3\u5f53\u524d\u76ee\u5f55<\/p>\n<p> tar -czf myfile.tar.gz test1 test2 test\/<br \/> \u5c06\u6587\u4ef6test1\u3001test2\u548c\u76ee\u5f55test\u4e00\u8d77\u6253\u5305\u5e76\u538b\u7f29\u6210myfile.tar.gz<\/p>\n<p> tar -xzf myfile.tar.gz<br \/> \u5c06\u538b\u7f29\u6253\u5305\u6587\u4ef6myfile.tar.gz\u89e3\u538b\u7f29\u5e76\u89e3\u5305\u5230\u5f53\u524d\u76ee\u5f55<\/p>\n<p> <span style=\"font-size: large;\"><strong><br \/> <\/strong><strong>\u540d\u79f0\uff1agzip\/gunzip<\/strong><\/span>\uff08gzip, gunzip, zcat &#8211; compress or expand files\uff09<br \/> <strong>\u4f7f\u7528\u6743\u9650 :<\/strong> \u6240\u6709\u4f7f\u7528\u8005<br \/> <strong>\u4f7f\u7528\u65b9\u5f0f :<\/strong> gzip [-dt&#8230;] [ name &#8230;\u00a0 ]<br \/> gunzip [options&#8230;] [ name &#8230;\u00a0 ]<br \/> <strong>\u8bf4\u660e :<\/strong> gzip\u548cbzip2\u90fd\u662f\u5c06\u6587\u4ef6\u538b\u7f29\uff0c\u4f46\u662f\u4e0d\u80fd\u5c06\u591a\u4e2a\u6587\u4ef6\u538b\u7f29\u6210\u4e00\u4e2a\u6587\u4ef6\uff0c\u800c\u4e14\u538b\u7f29\u597d\u6587\u4ef6\u4e4b\u540e\u6e90\u6587\u4ef6\u5c31\u88ab\u8986\u76d6\u4e86\u3002\uff08gzip\u548cbzip2\u5e38\u914d\u5408tar\u4f7f\u7528\uff09<\/p>\n<p> <strong>\u53c2\u6570 :<\/strong><br \/> -N N\u4e3a\u538b\u7f29\u7ea7\u522b\uff0c1\u6700\u5dee\uff0c9\u6700\u597d<br \/> -d \u89e3\u538b\u7f29<br \/> -t \u6d4b\u8bd5\u538b\u7f29\u5305<\/p>\n<p> <strong>\u8303\u4f8b\uff1a<\/strong><br \/> gzip -9 test.txt \u00a0 \u5c06test.txt\u4ee5\u6700\u597d\u7684\u538b\u7f29\u7387\u538b\u7f29\u4e3atest.txt.gz\uff08\u6e90\u6587\u4ef6\u8986\u76d6\uff09<br \/> gzip -d test.txt.gz \u00a0 \u6216\u8005\u00a0\u00a0 gunzip test.txt.gz\u00a0\u00a0\u00a0\u00a0 \u5c06test.txt.gz \u89e3\u538b\u7f29\uff08\u6e90\u538b\u7f29\u6587\u4ef6\u8986\u76d6\uff09<br \/> <strong><span style=\"font-size: medium;\"><strong><\/p>\n<p> <span style=\"font-size: large;\">\u540d\u79f0\uff1abzip2\/bunzip2<\/span><\/strong><\/span><\/strong>\uff08bzip2, bunzip2 &#8211; a block-sorting file compressor\uff09<br \/> <strong>\u4f7f\u7528\u6743\u9650 : <\/strong>\u6240\u6709\u4f7f\u7528\u8005<br \/> <strong>\u4f7f\u7528\u65b9\u5f0f :<\/strong> bzip2 [-dt&#8230;] [ name &#8230;\u00a0 ]<br \/> bunzip2 [options&#8230;] [ name &#8230;\u00a0 ]<br \/> <strong>\u8bf4\u660e :<\/strong> \u548cgzip\u4f7f\u7528\u975e\u5e38\u76f8\u4f3c\uff08gzip\u548cbzip2\u5e38\u914d\u5408tar\u4f7f\u7528\uff09<br \/> <strong><br \/> \u53c2\u6570 :<\/strong><br \/> -N N\u4e3a\u538b\u7f29\u7ea7\u522b\uff0c1\u6700\u5dee\uff0c9\u6700\u597d<br \/> -d \u89e3\u538b\u7f29<br \/> -t \u6d4b\u8bd5\u538b\u7f29\u5305<br \/> -v \u663e\u793a\u4fe1\u606f<\/p>\n<p> <strong>\u8303\u4f8b\uff1a<\/strong><br \/> bzip2 test.txt \u00a0 \u5c06test.txt\u538b\u7f29\u4e3atest.txt.bz2\uff08\u6e90\u6587\u4ef6\u8986\u76d6\uff09<br \/> bzip2 -d test.txt.bz2 \u00a0 \u6216\u8005\u00a0\u00a0 bunzip2 test.txt.bz2 \u00a0\u00a0\u00a0 \u5c06test.txt.bz2 \u89e3\u538b\u7f29\uff08\u6e90\u538b\u7f29\u6587\u4ef6\u8986\u76d6\uff09<br \/> bzip2 -vt test.txt.bz2\u00a0\u00a0 \u6d4b\u8bd5test.txt.bz2\u5e76\u663e\u793a\u6d4b\u8bd5\u60c5\u51b5<\/p>\n<p> <span style=\"font-size: large;\"><br \/> <strong>\u540d\u79f0\uff1azip<\/strong><\/span> \uff08package and compress (archive) files\uff09<br \/> <strong>\u4f7f\u7528\u6743\u9650 :<\/strong> \u6240\u6709\u4f7f\u7528\u8005<br \/> <strong>\u4f7f\u7528\u65b9\u5f0f :<\/strong> zip [-rdnm&#8230;] [ name &#8230;\u00a0 ]<br \/> <strong>\u8bf4\u660e\uff1a<\/strong>\u5c06\u6587\u4ef6\u6216\u76ee\u5f55\u538b\u7f29\u6210.zip\u6587\u4ef6<br \/> <strong>\u53c2\u6570\uff1a<\/strong><br \/> -N N\u4e3a\u538b\u7f29\u7ea7\u522b\uff0c1\u6700\u5dee\uff0c9\u6700\u597d<br \/> -r\u00a0 \u9012\u5f52\u8868\u793a\u9012\u5f52\u538b\u7f29\u5b50\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6<br \/> -d\u00a0 \u5220\u9664\u89e3\u538b\u7f29\u6587\u4ef6\u4e2d\u7684\u67d0\u4e00\u4e2a\u6587\u4ef6<br \/> -m \u5411\u538b\u7f29\u6587\u4ef6\u6dfb\u52a0\u6587\u4ef6<\/p>\n<p> <strong>\u8303\u4f8b\uff1a<\/strong><br \/> zip -r9 myfile.zip test1 test2 test\/<br \/> \u5c06\u6587\u4ef6test1\u3001test2\u548c\u76ee\u5f55test\u4e00\u8d77\u4ee5\u6700\u597d\u7684\u538b\u7f29\u7387\u538b\u7f29\u5230myfile.zip <\/p>\n<p> zip -d myfile.zip smart.txt<br \/> \u5220\u9664\u538b\u7f29\u6587\u4ef6\u4e2dsmart.txt\u6587\u4ef6<\/p>\n<p> zip -m myfile.zip .\/rpm_info.txt<br \/> \u5411\u538b\u7f29\u6587\u4ef6\u4e2dmyfile.zip\u4e2d\u6dfb\u52a0rpm_info.txt\u6587\u4ef6<\/p>\n<p> <span style=\"font-size: large;\"><strong>\u540d\u79f0\uff1aunzip<\/strong><\/span>\uff08list, test and extract compressed files in a ZIP archive\uff09<br \/> <strong>\u4f7f\u7528\u6743\u9650 : <\/strong>\u6240\u6709\u4f7f\u7528\u8005<br \/> <strong>\u4f7f\u7528\u65b9\u5f0f : <\/strong>unzip [-ondt&#8230;] [ name &#8230;\u00a0 ]<br \/> <strong>\u8bf4\u660e\uff1a<\/strong>\u663e\u793a\u3001\u6d4b\u8bd5\u3001\u89e3\u538b\u7f29.zip\u6587\u4ef6<br \/> <strong>\u53c2\u6570\uff1a<\/strong><br \/> -o \u4e0d\u63d0\u793a\u7684\u60c5\u51b5\u4e0b\u8986\u76d6\u6587\u4ef6<br \/> -n \u4e0d\u8986\u76d6\u5df2\u7ecf\u5b58\u5728\u7684\u6587\u4ef6<br \/> -d DEST\u6307\u660e\u5c06\u6587\u4ef6\u89e3\u538b\u7f29\u5230DEST\u76ee\u5f55\u4e0b<br \/> -t\u00a0\u00a0 \u6d4b\u8bd5\u538b\u7f29\u5305<br \/> <strong>\u8303\u4f8b\uff1a<\/strong><br \/> unzip -o -d test\/ test.zip<br \/> \u5c06test.zip\u89e3\u538b\u7f29\u5230\u5f53\u524d\u76ee\u5f55\u4e0b\u7684test\u6587\u4ef6\u5939\uff0c\u82e5\u9047\u5230\u540c\u540d\u6587\u4ef6\u76f4\u63a5\u8986\u76d6\u4e0d\u4e88\u63d0\u793a<br \/> <span style=\"font-size: large;\"><\/p>\n<p> <strong> \u540d\u79f0rar\/unrar<\/strong><\/span> \uff08archive files with compression \/ extract files from rar archives\uff09<br \/> <strong>\u4f7f\u7528\u6743\u9650 :<\/strong> \u6240\u6709\u4f7f\u7528\u8005<br \/> <strong>\u4f7f\u7528\u65b9\u5f0f : <\/strong>rar [axlt] [name] [ files\/directories &#8230;\u00a0 ]<br \/> unrar [xlt] [FILE]<br \/> <strong>\u8bf4\u660e\uff1a<\/strong>\u53ea\u80fd\u538b\u7f29\u548c\u89e3\u538b\u7f29.rar\u6587\u4ef6\uff0c\u6240\u6709\u529f\u80fd\u57fa\u672c\u90fd\u53ef\u4ee5\u7528rar\u6765\u5b8c\u6210\uff0c\u6240\u4ee5\u53ef\u4ee5\u5ffd\u7565unrar\uff08\u7279\u522b\u6ce8\u610frar\u30017z\u5e38\u7528\u7684\u662f\u9009\u9879\uff0c\u800c\u4e0d\u662f\u53c2\u6570\uff0c\u6240\u4ee5\u4e0d\u9700\u8981\u5728\u524d\u9762\u6253&#8221;-&#8220;\uff0c\u591a\u6253\u4e86&#8221;-&#8220;\u4f1a\u5bfc\u81f4\u9519\u8bef\uff09<br \/> <strong>\u9009\u9879\uff1a<\/strong><br \/> a \u6dfb\u52a0\u6587\u4ef6\u5230.rar\u538b\u7f29\u5305\uff0c\u5982\u679c\u6ca1\u6709\u8fd9\u4e2a\u538b\u7f29\u5305\u5219\u521b\u5efa<br \/> x \u4ee5\u5b8c\u6574\u7684\u8def\u5f84\u89e3\u538b\u7f29\u5230\u5f53\u524d\u76ee\u5f55<br \/> l\u00a0 \u5217\u51fa\u538b\u7f29\u5305\u5185\u7684\u5185\u5bb9<br \/> t\u00a0 \u6d4b\u8bd5\u538b\u7f29\u5305\u662f\u5426\u53ef\u7528<\/p>\n<p> <strong>\u8303\u4f8b\uff1a<\/strong><br \/> rar a myfile.rar test1 test2 test\/<br \/> \u5c06\u6587\u4ef6test1\u3001test2\u548c\u76ee\u5f55test\u4e00\u8d77\u4ee5\u6700\u597d\u7684\u538b\u7f29\u7387\u538b\u7f29\u5230myfile.rar<\/p>\n<p> rar x test.rar\u00a0 \u6216\u8005\u00a0 unrar x test.rar<br \/> \u89e3\u538b\u7f29test.rar\u5230\u5f53\u524d\u76ee\u5f55<\/p>\n<p> rar t test.rar\u00a0 \u6216\u8005\u00a0 unrar t test.rar<br \/> \u6d4b\u8bd5test.rar<\/p>\n<p> rar l test.rar\u00a0 \u6216\u8005\u00a0 unrar l test.rar<br \/> \u663e\u793atest.rar\u4e2d\u7684\u6587\u4ef6<\/p>\n<p> <span style=\"font-size: large;\"><strong>\u540d\u79f0\uff1a7z<\/strong><\/span>\uff08A file archiver with highest compression ratio\uff09<br \/> <strong>\u4f7f\u7528\u6743\u9650 :<\/strong> \u6240\u6709\u4f7f\u7528\u8005<br \/> <strong>\u4f7f\u7528\u65b9\u5f0f : <\/strong>7z [axlt] [name] [ files\/directories &#8230;\u00a0 ]<br \/> <strong>\u8bf4\u660e\uff1a<\/strong> 7z\u548crar\u5f88\u76f8\u4f3c\uff0c\u4f46\u5728\u89e3\u538b\u7f29\u65b9\u97627z\u6bd4\u5176\u4ed6\u51e0\u4e2a\u547d\u4ee4\u90fd\u8981\u65b9\u4fbf\uff0c\u5b83\u53ef\u4ee5\u89e3\u538b\u7f29\u4ee5\u4e0a\u6240\u6709\u683c\u5f0f\u7684\u538b\u7f29\u6216\u6253\u5305\u6587\u4ef6\u3002\u4f46\u662f\u4e0d\u8981\u75287z\u6765\u538b\u7f29\u5176\u4ed6\u683c\u5f0f\u7684\u6587\u4ef6\uff0c\u5426\u5219\u53ea\u80fd\u75287z\u89e3\u538b\u7f29\uff0c\u800c\u522b\u7684\u76f8\u5e94\u547d\u4ee4\u89e3\u538b\u7f29\u4f1a\u51fa\u73b0\u9519\u8bef\uff08\u4e0d\u652f\u6301\uff0c\u4e71\u7801\uff0c\u6587\u4ef6\u5927\u5c0f\u4e3a\u96f6\u7b49\uff09<br \/> <strong>\u9009\u9879\uff1a<\/strong><br \/> a\u00a0\u00a0\u00a0\u00a0 \u6dfb\u52a0\u6587\u4ef6\u5230\u538b\u7f29\u5305<br \/> x\u00a0\u00a0\u00a0\u00a0\u00a0 \u89e3\u538b\u7f29\u5230\u5b8c\u5168\u8def\u5f84<br \/> l\u00a0\u00a0\u00a0\u00a0\u00a0 \u67e5\u770b\u538b\u7f29\u5305\u7684\u5185\u5bb9<br \/> t\u00a0\u00a0\u00a0\u00a0\u00a0 \u6d4b\u8bd5\u538b\u7f29\u5305<br \/> <strong>\u8303\u4f8b\uff1a<\/strong><br \/> 7z a myfile.7z  test1 test2 test\/<br \/> \u5c06\u6587\u4ef6test1\u3001test2\u548c\u76ee\u5f55test\u4e00\u8d77\u4ee5\u6700\u597d\u7684\u538b\u7f29\u7387\u538b\u7f29\u5230myfile.7z<\/p>\n<p> 7z x test.rar<br \/> \u89e3\u538b\u7f29test.rar\u5230\u5f53\u524d\u76ee\u5f55<\/p>\n<p> 7z t test.zip<br \/> \u6d4b\u8bd5test.zip<\/p>\n<p> 7z l test.tar<br \/> \u663e\u793atest.tar\u4e2d\u7684\u6587\u4ef6<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5b9e\u4f8b\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tar -czf domain.tar Domain\/ tar -czf Dossiers.tar Dossiers\/ \u00a0 \u540e\u53f0\u8fd0\u884c nohup tar -czf domain.tar Domain\/ &amp; nohup tar -czf Dossiers.tar Dossiers\/ &amp; \u00a0 nohup tar -cf backup.tar Domain\/ Dossiers\/ logs\/ &amp; \u00a0 \u00a0 \u00a0 \u540d\u79f0 : tar (The GNU version of the tar archiving utility) \u4f7f\u7528\u6743\u9650 : \u6240\u6709\u4f7f\u7528\u8005 \u4f7f\u7528\u65b9\u5f0f : tar [-czxf] [NAME] [FILES\/DIRECTORIES] [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"class_list":["post-114","post","type-post","status-publish","format-standard","hentry","category-centos-6"],"_links":{"self":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/114","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/comments?post=114"}],"version-history":[{"count":0,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/114\/revisions"}],"wp:attachment":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/media?parent=114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/categories?post=114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/tags?post=114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}