{"id":18074,"date":"2024-03-31T04:02:29","date_gmt":"2024-03-30T20:02:29","guid":{"rendered":"https:\/\/www.linuxcool.com\/sfwfwqdtmlss"},"modified":"2024-03-31T04:02:29","modified_gmt":"2024-03-30T20:02:29","slug":"sfwfwqdtmlss","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/sfwfwqdtmlss","title":{"rendered":"SSH\u8bbf\u95ee\u670d\u52a1\u5668\u7684tar\u547d\u4ee4\u662f\u4ec0\u4e48\uff1f\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u901a\u8fc7SSH\u8bbf\u95ee\u670d\u52a1\u5668\uff0c\u96be\u514d\u4f1a\u8981\u7528\u5230\u538b\u7f29linux\u64cd\u4f5c\u7cfb\u7edf\u8bba\u6587\uff0c\u89e3\u538b\u7f29\uff0c\u6253\u5305\uff0c\u89e3\u5305\u7b49\uff0c\u8fd9\u65f6\u4faftar<a style='color:#0000CC;font-size:16px' href='https:\/\/www.linuxcool.com\/' target='_blank' rel=\"noopener\">\u547d\u4ee4<\/a>\u5c31\u662f\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u4e00\u4e2a\u529f\u80fd\u5f3a\u608d\u7684\u5de5\u5177<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>tar\u547d\u4ee4\u53ef\u4ee5\u4e3alinux\u7684\u6587\u4ef6\u548c\u76ee\u5f55\u521b\u5efa\u6863\u6848\u3002\u501f\u52a9tar\uff0c\u53ef\u4ee5\u4e3a\u67d0\u4e00\u7279\u5b9a\u6587\u4ef6\u521b\u5efa\u6863\u6848\uff08\u5907\u4efd\u6587\u4ef6\uff09<strong>linux tar\u547d\u4ee4<\/strong>\uff0c\u4e5f\u53ef\u4ee5\u5728\u6863\u6848\u4e2d\u6539\u53d8\u6587\u4ef6\uff0c\u6216\u5219\u5411\u6863\u6848\u4e2d\u52a0\u5165\u65b0\u7684\u6587\u4ef6\u3002tar\u6700\u521d\u88ab\u62ff\u6765\u5728\u78c1\u5e26\u4e0a\u521b\u5efa\u6863\u6848<strong>linux tar\u547d\u4ee4<\/strong>\uff0c\u5982\u4eca\uff0c\u7528\u6237\u53ef\u4ee5\u5728\u4efb\u4f55\u8bbe\u5907\u4e0a\u521b\u5efa\u6863\u6848\u3002\u501f\u52a9tar\u547d\u4ee4\uff0c\u53ef\u4ee5\u628a\u4e00\u5927\u5806\u7684\u6587\u4ef6\u548c\u76ee\u5f55\u5168\u90e8\u6253\u5305\u6210\u4e00\u4e2a\u6587\u4ef6\uff0c\u8fd9\u5bf9\u4e8e\u5907\u4efd\u6587\u4ef6\u6216\u5c06\u51e0\u4e2a\u6587\u4ef6\u7ec4\u5408\u6210\u4e3a\u4e00\u4e2a\u6587\u4ef6\u4ee5\u6613\u4e8e\u7f51\u8def\u4f20\u8f93\u662f\u5341\u5206\u6709\u7528\u7684\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u6253\u5305\u548c\u538b\u7f29<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><a style='color:#0000CC;font-size:16px' href='https:\/\/www.linuxprobe.com\/' target='_blank' rel=\"noopener\">Linux<\/a>\u4e2d\u597d\u591a\u538b\u7f29\u7a0b\u5e8f\u53ea\u80fd\u9488\u5bf9\u4e00\u4e2a\u6587\u4ef6\u8fdb\u884c\u538b\u7f29\uff0c\u8fd9\u6837\u5f53\u4f60\u60f3\u8981\u538b\u7f29\u4e00\u5927\u5806\u6587\u4ef6\u65f6\uff0c\u4f60\u5f97\u5148\u5c06\u8fd9\u4e00\u5927\u5806\u6587\u4ef6\u5148\u6253\u6210\u4e00\u4e2a\u5305\uff08tar\u547d\u4ee4\uff09\uff0c\u4e4b\u540e\u518d\u7528\u538b\u7f29\u7a0b\u5e8f\u8fdb\u884c\u538b\u7f29\uff08gzipbzip2\u547d\u4ee4\uff09<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>linux\u4e0b\u6700\u5e38\u7528\u7684\u6253\u5305\u7a0b\u5e8f\u5c31\u662ftar\u4e86\uff0c\u4f7f\u7528tar\u7a0b\u5e8f\u6253\u4e0b\u6765\u7684\u5305\u6211\u4eec\u5e38\u79f0\u4e3atar\u5305\uff0ctar\u5305\u6587\u4ef6\u7684\u547d\u4ee4\u4e00\u822c\u90fd\u662f\u4ee5.tar\u7ed3\u5c3e\u7684\u3002\u751f\u6210tar\u5305\u540e\uff0c\u5c31\u53ef\u4ee5\u7528\u5176\u5b83\u7684\u7a0b\u5e8f\u6765\u8fdb\u884c\u538b\u7f29\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u547d\u4ee4\u683c\u5f0f<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>&gt; tar [\u5fc5\u8981\u53c2\u6570] [\u9009\u62e9\u53c2\u6570] \u6587\u4ef6\n<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u547d\u4ee4\u529f\u80fd<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u62ff\u6765\u538b\u7f29\u548c\u89e3\u538b\u6587\u4ef6\u3002tar\u672c\u8eab\u4e0d\u5177\u6709\u538b\u7f29\u529f\u80fd\u3002\u4ed6\u662f\u8c03\u7528\u538b\u7f29\u529f\u80fd\u5b9e\u73b0\u7684\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u547d\u4ee4\u53c2\u6570\u5fc5\u8981\u53c2\u6570\u9009\u62e9\u53c2\u6570\u6253\u5305\u4e00\u4e2a\u6587\u4ef6,\u4e0d\u538b\u7f29<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>&gt; tar -cvf rumenz.tar rumenz.txt\n<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u6253\u5305\u5e76\u538b\u7f29\u4e00\u4e2a\u6587\u4ef6(\u4f7f\u7528gzip\u538b\u7f29)<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><img style='max-height:500px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2024\/03\/1711828944771_1.png' alt='linux tar\u547d\u4ee4_linux\u4e0b\u7684tar\u538b\u7f29\u547d\u4ee4_linux\u6253\u5305\u547d\u4ee4tar' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>&gt; tar -zcvf rumenz.tar.gz rumenz.txt\n<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u6253\u5305\u5e76\u538b\u7f29\u4e00\u4e2a\u6587\u4ef6(\u4f7f\u7528bzip2\u538b\u7f29)<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>&gt; tar -jcvf rumenz.tar.bz2 rumenz.txt\n<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5728\u9009\u9879f\u4ee5\u540e\u7684\u6587\u4ef6\u6863\u540d\u662f\u81ea\u5df1\u53d6\u7684\uff0c\u6211\u4eec\u4e60\u60ef\u4e0a\u90fd\u7528.tar\u6765\u4f5c\u4e3a\u8bc6\u522b\u3002\u82e5\u679c\u52a0z\u9009\u9879\uff0c\u5219\u4ee5.tar.gz\u6216.tgz\u6765\u4ee3\u8868gzip\u538b\u7f29\u8fc7\u7684tar\u5305\uff1b\u5018\u82e5\u52a0j\u9009\u9879ubuntu linux\uff0c\u5219\u4ee5.tar.bz2\u6765\u4f5c\u4e3atar\u5305\u540d\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5217\u4e3e\u6253\u5305\u538b\u7f29\u6587\u4ef6\u4e0a\u9762\u7684\u5185\u5bb9<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'><img style='max-height:500px;max-width:80%;margin: 10px auto' src='https:\/\/www.linuxcool.com\/wp-content\/uploads\/2024\/03\/1711828944771_2.jpg' alt='linux\u6253\u5305\u547d\u4ee4tar_linux\u4e0b\u7684tar\u538b\u7f29\u547d\u4ee4_linux tar\u547d\u4ee4' \/><\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>&gt; tar -ztvf rumenz.tar.gz\n<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u56e0\u4e3a\u6211\u4eec\u4f7f\u7528gzip\u538b\u7f29\u7684rumenz.tar.gz\uff0c\u6240\u4ee5\u8981\u67e5\u9605rumenz.tar.gz\u5305\u5185\u7684\u6587\u4ef6\u65f6\uff0c\u5c31\u5f97\u8981\u52a0\u4e0az\u8fd9\u4e2a\u9009\u9879\u4e86<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>tar.gz\u89e3\u538b\u7f29<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>&gt; tar -xzvf rumenz.tar.gz\n<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>tar.gz\u89e3\u538b\u7f29\u5230\/tmp\u76ee\u5f55<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>&gt; tar -xzvf rumenz.tar.gz -C \/tmp\n<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u53ea\u89e3\u538brumenz.tar.gz\u4e0a\u9762\u76841.txt,2.txt<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>&gt; tar -zcvf rumenz.tar.gz *.txt\n\/\/\u67e5\u770brumenz.tar.gz\u91cc\u9762\u7684\u6587\u4ef6(\u5728\u4e0d\u89e3\u538b\u7f29\u7684\u60c5\u51b5\u4e0b\u770b)\n&gt; tar -ztvf rumenz.tar.gz\n1.txt\n2.txt\n3.txt\n4.txt\n&gt; tar -zxvf rumenz.tar.gz 1.txt 2.txt\n1.txt\n2.txt\n&gt; ls \n1.txt  2.txt  rumenz.tar.gz\n<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u538b\u7f29\u6587\u4ef6\u5e76\u4fdd\u7559\u5176\u6743\u9650<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>&gt; tar -zcpvf rumenz.tar.gz 1.txt 2.txt 3.txt 4.txt\n<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u8fd9\u4e2a-p\u7684\u5c5e\u6027\u662f\u5f88\u91cd\u8981\u7684\uff0c\u5c24\u5176\u662f\u5f53\u60a8\u8981\u4fdd\u7559\u539f\u5148\u6587\u4ef6\u7684\u5c5e\u6027\u65f6\u3002<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u4e0d\u6253\u5305\u538b\u7f29\u67d0\u4e2a\u6587\u4ef6(\u6216\u76ee\u5f55)<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>&gt; tar --exclude rumenz\/doc rumenz.tar.gz rumenz\/*\n<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u5728\/etc\u5f53\u4e2d\uff0c\u6bd42021\/01\/01\u65b0\u7684\u6587\u4ef6\u624d\u5907\u4efd<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\n<pre><code>&gt; tar -N \"2021\/01\/01\" -zcvf etc.tar.gz \/etc\n<\/code><\/pre>\n<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>bzip2\u538b\u7f29,\u67e5\u770b,\u89e3\u538b<\/p>\n<p style='margin-bottom:16px;color:#555555;font-size:16px;line-height:200%;text-indent:2em'>\u539f\u6587\u94fe\u63a5:<\/p>\n","protected":false},"excerpt":{"rendered":"<p>tar\u547d\u4ee4\u53ef\u4ee5\u4e3alinux\u7684\u6587\u4ef6\u548c\u76ee\u5f55\u521b\u5efa\u6863\u6848\u3002bzip2\u547d\u4ee4\uff09\u547d\u4ee4\u683c\u5f0f\u6253\u5305\u5e76\u538b\u7f29\u4e00\u4e2a\u6587\u4ef6(\u4f7f\u7528bzip2\u538b\u7f29)tar.gz\u89e3\u538b\u7f29tar.gz\u89e3\u538b\u7f29\u5230\/tmp\u76ee\u5f55\u53ea\u89e3\u538brumenz.tar.gz\u91cc\u9762\u76841.txt,2.txt<\/p>\n","protected":false},"author":1,"featured_media":18075,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[111,112],"class_list":["post-18074","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledge","tag-t","tag-tdb"],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/18074","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=18074"}],"version-history":[{"count":0,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/18074\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media\/18075"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=18074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=18074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=18074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}