{"id":16687,"date":"2023-12-06T04:11:31","date_gmt":"2023-12-05T20:11:31","guid":{"rendered":"https:\/\/www.linuxcool.com\/ljysqtmlqsty"},"modified":"2023-12-06T04:11:31","modified_gmt":"2023-12-05T20:11:31","slug":"ljysqtmlqsty","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/ljysqtmlqsty","title":{"rendered":"Linux\u89e3\u538b\u795e\u5668\uff0ctar\u547d\u4ee4\u4eb2\u8eab\u4f53\u9a8c\u544a\u8bc9\u4f60\u5982\u4f55\u64cd\u4f5c"},"content":{"rendered":"<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5728\u6211\u591a\u5e74\u7684<a style='color:#0000CC' href='https:\/\/www.linuxprobe.com\/' target='_blank' rel=\"noopener\">Linux<\/a>\u4f7f\u7528\u7ecf\u9a8c\u4e2d\uff0ctar<a style='color:#0000CC' href='https:\/\/www.linuxcool.com\/' target='_blank' rel=\"noopener\">\u547d\u4ee4<\/a>\u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u4e14\u5e38\u7528\u7684\u5de5\u5177linux\u5165\u95e8\uff0c\u5c24\u5176\u662f\u5728\u6587\u4ef6\u6253\u5305\u548c\u89e3\u538b\u7f29\u65b9\u9762\u3002\u6211\u4eb2\u81ea\u4f7f\u7528\u8fc7tar\u547d\u4ee4\u8fdb\u884c\u89e3\u538b\u64cd\u4f5c\uff0c\u4e0b\u9762\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u6211\u7684\u4eb2\u8eab\u4f53\u9a8c\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>1.\u5b89\u88c5tar\u547d\u4ee4<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u786e\u4fdd<a style='color:#0000CC' href='https:\/\/www.linuxdown.com\/' target='_blank' rel=\"noopener\">\u7cfb\u7edf<\/a>\u4e2d\u5df2\u7ecf\u5b89\u88c5\u4e86tar\u547d\u4ee4\u3002\u5728\u7ec8\u7aef\u4e2d\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u68c0\u67e5tar\u662f\u5426\u5df2\u5b89\u88c5\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\ntar --version\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5982\u679c\u663e\u793a\u4e86tar\u7684\u7248\u672c\u4fe1\u606flinux\u6f0f\u6d1e\u626b\u63cf\uff0c\u5219\u8868\u793a\u5df2\u7ecf\u5b89\u88c5\u6210\u529f\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>2.\u89e3\u538b.tar\u6587\u4ef6<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u540d\u4e3aarchive.tar\u7684\u6587\u4ef6\u9700\u8981\u89e3\u538b\u3002\u5728\u7ec8\u7aef\u4e2d\u5207\u6362\u5230\u8be5\u6587\u4ef6\u6240\u5728\u7684\u76ee\u5f55\uff0c\u5e76\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\ntar -xvf archive.tar\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u8fd9\u5c06\u4f1a\u89e3\u538b\u51faarchive.tar\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u5185\u5bb9\uff0c\u5e76\u663e\u793a\u89e3\u538b\u8fdb\u5ea6\u548c\u6587\u4ef6\u5217\u8868\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>3.\u89e3\u538b.tar.gz\u6587\u4ef6<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5982\u679c\u6211\u4eec\u6709\u4e00\u4e2a\u540d\u4e3aarchive.tar.gz\u7684\u6587\u4ef6\u9700\u8981\u89e3\u538b\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u64cd\u4f5c\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\ntar -xzvf archive.tar.gz\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u540c\u65f6\u8fdb\u884c\u89e3\u538b\u548c\u89e3\u538b\u7f29\u64cd\u4f5c\uff0c\u5e76\u663e\u793a\u89e3\u538b\u8fdb\u5ea6\u548c\u6587\u4ef6\u5217\u8868\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>4.\u89e3\u538b.tar.bz2\u6587\u4ef6<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><img style='max-height:350px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2023\/12\/1701807091223_0.png' alt='linux tar\u89e3\u538b\u547d\u4ee4_\u89e3\u538b\u547d\u4ee4linuxtar_\u89e3\u538b\u547d\u4ee4linuxgz' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5bf9\u4e8e.tar.bz2\u683c\u5f0f\u7684\u6587\u4ef6<strong>linux tar\u89e3\u538b\u547d\u4ee4<\/strong>\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u89e3\u538b\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\ntar -xjvf archive.tar.bz2\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u89e3\u538b\u51faarchive.tar.bz2\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u5185\u5bb9\uff0c\u5e76\u663e\u793a\u89e3\u538b\u8fdb\u5ea6\u548c\u6587\u4ef6\u5217\u8868\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>5.\u89e3\u538b\u5230\u6307\u5b9a\u76ee\u5f55<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5982\u679c\u6211\u4eec\u60f3\u5c06\u6587\u4ef6\u89e3\u538b\u5230\u6307\u5b9a\u7684\u76ee\u5f55\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\ntar -xvf archive.tar -C\/path\/to\/directory\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5176\u4e2d\uff0c\/path\/to\/directory\u662f\u4f60\u8981\u89e3\u538b\u5230\u7684\u76ee\u5f55\u8def\u5f84\u3002\u8fd9\u6837\uff0c\u89e3\u538b\u540e\u7684\u6587\u4ef6\u5c06\u4f1a\u88ab\u653e\u7f6e\u5728\u6307\u5b9a\u76ee\u5f55\u4e2d\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>6.\u67e5\u770btar\u6587\u4ef6\u5185\u5bb9<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u6709\u65f6\u5019\uff0c\u6211\u4eec\u53ea\u662f\u60f3\u67e5\u770btar\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u800c\u4e0d\u8fdb\u884c\u89e3\u538b\u64cd\u4f5c\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b9e\u73b0\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\ntar -tvf archive.tar\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u663e\u793atar\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u5217\u8868\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>7.\u89e3\u538b\u6307\u5b9a\u6587\u4ef6<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5982\u679c\u6211\u4eec\u53ea\u60f3\u89e3\u538btar\u6587\u4ef6\u4e2d\u7684\u67d0\u4e2a\u6216\u67d0\u51e0\u4e2a\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\ntar -xvf archive.tar file1 file2\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5176\u4e2d\uff0cfile1\u548cfile2\u662f\u4f60\u8981\u89e3\u538b\u7684\u6587\u4ef6\u540d\u3002\u8fd9\u6837\uff0c\u53ea\u6709\u8fd9\u4e9b\u6587\u4ef6\u4f1a\u88ab\u89e3\u538b\u51fa\u6765\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>8.\u89e3\u538b\u5230\u6807\u51c6\u8f93\u51fa<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u6709\u65f6\u5019\uff0c\u6211\u4eec\u5e0c\u671b\u5c06tar\u6587\u4ef6\u89e3\u538b\u5230\u6807\u51c6\u8f93\u51fa\u800c\u4e0d\u662f\u5b9e\u9645\u5199\u5165\u78c1\u76d8\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b9e\u73b0\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\ntar -xOf archive.tar | less\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u5c06tar\u6587\u4ef6\u7684\u5185\u5bb9\u8f93\u51fa\u5230\u5c4f\u5e55\uff0c\u5e76\u4f7f\u7528less\u547d\u4ee4\u8fdb\u884c\u5206\u9875\u67e5\u770b\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>9.\u89e3\u538b\u65f6\u8df3\u8fc7\u90e8\u5206\u6587\u4ef6<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5982\u679c\u6211\u4eec\u5728\u89e3\u538btar\u6587\u4ef6\u65f6\u60f3\u8981\u8df3\u8fc7\u67d0\u4e9b\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><img style='max-height:350px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2023\/12\/1701807091223_1.png' alt='\u89e3\u538b\u547d\u4ee4linuxgz_linux tar\u89e3\u538b\u547d\u4ee4_\u89e3\u538b\u547d\u4ee4linuxtar' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\ntar -xvf archive.tar --exclude=file1 --exclude=file2\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5176\u4e2d\uff0cfile1\u548cfile2\u662f\u4f60\u60f3\u8981\u8df3\u8fc7\u7684\u6587\u4ef6\u540d\u3002\u8fd9\u6837\uff0c\u8fd9\u4e9b\u6587\u4ef6\u5c06\u4e0d\u4f1a\u88ab\u89e3\u538b\u51fa\u6765\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><b>10.\u89e3\u538b\u65f6\u8986\u76d6\u540c\u540d\u6587\u4ef6<\/b><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u6709\u65f6\u5019\uff0c\u5728\u89e3\u538btar\u6587\u4ef6\u65f6\u53ef\u80fd\u4f1a\u9047\u5230\u540c\u540d\u6587\u4ef6\u7684\u51b2\u7a81\u3002\u5982\u679c\u6211\u4eec\u5e0c\u671b\u89e3\u538b\u65f6\u8986\u76d6\u540c\u540d\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre>\ntar -xvf archive.tar --overwrite\n<\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u8fd9\u4e2a\u547d\u4ee4\u4f1a\u5728\u89e3\u538b\u8fc7\u7a0b\u4e2d\u8986\u76d6\u540c\u540d\u6587\u4ef6<strong>linux tar\u89e3\u538b\u547d\u4ee4<\/strong>\uff0c\u786e\u4fdd\u6700\u65b0\u7684\u6587\u4ef6\u5f97\u4ee5\u4fdd\u7559\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u4ee5\u4e0a\u5c31\u662f\u6211\u4eb2\u8eab\u4f53\u9a8c\u7684Linux tar\u89e3\u538b\u547d\u4ee4\u7684\u8be6\u7ec6\u4ecb\u7ecd\u3002\u901a\u8fc7\u8fd9\u4e9b\u547d\u4ee4\uff0c\u6211\u4eec\u53ef\u4ee5\u8f7b\u677e\u5730\u8fdb\u884c\u5404\u79cd\u89e3\u538b\u64cd\u4f5c\uff0c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\u3002\u5e0c\u671b\u5bf9\u4f60\u6709\u5e2e\u52a9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u4eb2\u81ea\u4f7f\u7528\u8fc7tar\u547d\u4ee4\u8fdb\u884c\u89e3\u538b\u64cd\u4f5c\uff0c\u4e0b\u9762\u6211\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u6211\u7684\u4eb2\u8eab\u4f53\u9a8c\u3002tar\u7684\u6587\u4ef6\u9700\u8981\u89e3\u538b\u3002gz\u7684\u6587\u4ef6\u9700\u8981\u89e3\u538b\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u64cd\u4f5c\uff1a\u5982\u679c\u6211\u4eec\u53ea\u60f3\u89e3\u538btar\u6587\u4ef6\u4e2d\u7684\u67d0\u4e2a\u6216\u67d0\u51e0\u4e2a\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a\u5982\u679c\u6211\u4eec\u5728\u89e3\u538btar\u6587\u4ef6\u65f6\u60f3\u8981\u8df3\u8fc7\u67d0\u4e9b\u6587\u4ef6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1atar\u89e3\u538b\u547d\u4ee4\u7684\u8be6\u7ec6\u4ecb\u7ecd\u3002<\/p>\n","protected":false},"author":1,"featured_media":16688,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[991,37,40,32,194],"class_list":["post-16687","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledge","tag-tm-3","tag-ml","tag-cz","tag-wj","tag-jy"],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/16687","targetHints":{"allow":["GET"]}}],"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=16687"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/16687\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media\/16688"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=16687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=16687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=16687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}