{"id":592,"date":"2024-03-14T18:06:18","date_gmt":"2024-03-14T10:06:18","guid":{"rendered":"http:\/\/www.ccwifi.cc\/blogs\/?p=592"},"modified":"2024-03-14T18:06:18","modified_gmt":"2024-03-14T10:06:18","slug":"linux%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%e5%8e%8b%e7%bc%a9%e5%92%8c%e8%a7%a3%e5%8e%8b%e7%bc%a9%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/www.ccwifi.cc\/blogs\/2024\/03\/14\/linux%e5%b8%b8%e7%94%a8%e5%91%bd%e4%bb%a4%e5%8e%8b%e7%bc%a9%e5%92%8c%e8%a7%a3%e5%8e%8b%e7%bc%a9%e5%91%bd%e4%bb%a4\/","title":{"rendered":"Linux\u5e38\u7528\u547d\u4ee4\u2014\u2014\u538b\u7f29\u548c\u89e3\u538b\u7f29\u547d\u4ee4"},"content":{"rendered":"<div>\n<p>\u5728\u7ebfwifi\u8dd1\u5305 \u91d1\u521a\u5305\u8dd1\u5305 cap\u8dd1\u5305 hccapx ewsa\u5728\u7ebf \u5c31\u6765 <strong><a href=\"https:\/\/ccwifi.cc\" target=\"_blank\" rel=\"noopener\">\u63e1\u624b\u5305\u8dd1\u5305<\/a><\/strong><\/p>\n<p>\u5404\u4f4d\u597d \u53c8\u89c1\u9762\u4e86 \u6211\u662f\u66f9\u64cd \u4eca\u5929\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7\u65b0\u7684\u6559\u7a0b<\/p>\n<p>\u5e0c\u671b\u5404\u4f4d\u7ec6\u5fc3\u5b66\u4e60 \u4f4e\u8c03\u7528\u7f51<\/p>\n<\/div>\n<pre><code class=\"language-text\">\u547d\u4ee4\u683c\u5f0f\u5982\u4e0b\uff1a\n[root@localhost ~ ] #zip [\u9009\u9879] \u538b\u7f29\u5305\u540d \u6e90\u6587\u4ef6\u6216\u6e90\u76ee\u5f55\n\u9009\u9879\uff1a\n-r\uff1a\u6307\u5b9a\u8981\u538b\u7f29\u7684\u76ee\u5f55\n\u4f8b\u5982\uff1a\n[root@localhost \uff5e] #zip ana.zip anaconda-ks.cfg\n# \u628a\u591a\u4e2a\u6587\u4ef6\u538b\u7f29\u5230\u4e00\u4e2a\u538b\u7f29\u6587\u4ef6\u4e2d\n[root@localhost ~] # zip test.zip abc abcd\nadding:abc (deflated 56%)\nadding:abcd(stored 0%)\n# \u628a\u591a\u4e2a\u6587\u4ef6\u548c\u76ee\u5f55\u538b\u7f29\u5230\u4e00\u4e2a\u538b\u7f29\u6587\u4ef6\u4e2d\n[root@DevOps test] #zip  123.zip abc def -r \/root\/<\/code><\/pre>\n<p>\u5728Linux\u7cfb\u7edf\u4e0b\uff0c\u6587\u4ef6\u662f\u4e0d\u533a\u5206\u6269\u5c55\u540d\u7684\u3002\u4f46\u662fLinux\u7cfb\u7edf\u652f\u6301\u5f88\u591a\u79cd\u538b\u7f29\u683c\u5f0f\uff0c\u5982\u679c\u538b\u7f29\u6587\u4ef6\u4e0d\u5199\u4e0a\u6269\u5c55\u540d\uff0c\u4f60\u81ea\u5df1\u521b\u5efa\u7684\u538b\u7f29\u6587\u4ef6\u53ef\u80fd\u4f60\u81ea\u5df1\u77e5\u9053\uff0c\u4f46\u662f\u8fc7\u4e00\u9635\u4f60\u53ef\u80fd\u4e5f\u5fd8\u8bb0\u4e86\u3002\u5176\u4ed6\u7ba1\u7406\u5458\u4e5f\u5f88\u96be\u77e5\u9053\u8be5\u6587\u4ef6\u662f\u4e00\u4e2a\u538b\u7f29\u6587\u4ef6\u3002\u540c\u65f6\u6bcf\u4e00\u79cd\u538b\u7f29\u6587\u4ef6\u7684\u89e3\u538b\u7f29\u683c\u5f0f\u4e5f\u662f\u4e0d\u540c\u7684\uff0c\u5982\u679c\u4f60\u6ca1\u6709\u5199\u538b\u7f29\u6587\u4ef6\u7684\u6269\u5c55\u540d\uff0c\u89e3\u538b\u7f29\u7684\u65f6\u5019\u5c31\u4f1a\u5f88\u9ebb\u70e6\uff0c\u4f60\u9700\u8981\u5148\u624b\u52a8\u67e5\u8be2\u4e00\u4e0b\u8be5\u538b\u7f29\u6587\u4ef6\u7684\u7c7b\u578b\uff0c\u518d\u8fdb\u884c\u89e3\u538b\u7f29\u3002\u6240\u4ee5\u538b\u7f29\u6587\u4ef6\u4e00\u5b9a\u8981\u5199\u4e0a\u6269\u5c55\u540d\uff0c\u8fd9\u4e2a\u6269\u5c55\u540d\u4e0d\u662f\u7ed9\u7cfb\u7edf\u770b\u7684\uff0c\u662f\u65b9\u4fbf\u7ba1\u7406\u5458\u64cd\u4f5c\u7684\u3002 \u5728Linux\u4e2d\u53ef\u4ee5\u8bc6\u522b\u7684\u3001\u5e38\u89c1\u7684\u538b\u7f29\u683c\u5f0f\u6709\u5341\u51e0\u79cd\uff0c\u6bd4\u5982\u201c.zip\u201d\u201c.gz\u201d\u201c.bz2\u201d\u201c.tar\u201d\u201ctar.gz\u201d\u201ctar.bz2\u201d\u7b49\u3002\u4e0b\u9762\u8bf4\u4e00\u4e9b\u5e38\u89c1\u7684\u538b\u7f29\u683c\u5f0f\u3002  \u4e00\u3001\u201c.zip\u201d\u683c\u5f0f  \u201c.zip\u201d\u662fWindows\u4e2d\u6700\u5e38\u7528\u7684\u538b\u7f29\u683c\u5f0f\uff0cLinux\u4e5f\u53ef\u4ee5\u6b63\u786e\u8bc6\u522b\u201c.zip\u201d\u683c\u5f0f\uff0c\u8fd9\u662f\u4e00\u79cd\u53ef\u4ee5\u65b9\u4fbf\u5730\u548cWindows\u7cfb\u7edf\u901a\u7528\u538b\u7f29\u6587\u4ef6\u3002  \u6ce8\u610f\uff1awindows\u7cfb\u7edf\u4e0b\u8fd8\u6709\u4e00\u4e9b\u538b\u7f29\u5305\u5982.rar\u3001.7z\uff0c\u8fd9\u4e9b\u538b\u7f29\u683c\u5f0f\u7684\u6587\u4ef6\u5728Linux\u7cfb\u7edf\u5c31\u4e0d\u80fd\u4f7f\u7528\u4e86\u3002\u201c.zip\u201d\u6211\u4eec\u5728Linux\u7cfb\u7edf\u4e2d\u4e0d\u5e38\u7528\uff0c\u4e3b\u8981\u662f\u7528\u4e8e\u548cwindows\u7cfb\u7edf\u7684\u538b\u7f29\u6587\u4ef6\u901a\u7528\u30021\u3001\u201c.zip\u201d\u683c\u5f0f\u7684\u538b\u7f29\u547d\u4ee4  \u538b\u7f29\u547d\u4ee4\u5c31\u662fzip\uff0c\u5176\u57fa\u672c\u4fe1\u606f\u5982\u4e0b\u3002  <\/p>\n<pre><code class=\"language-text\">\u547d\u4ee4\u683c\u5f0f\u5982\u4e0b\uff1a\n[root@localhost ~ ] # unzip [\u9009\u9879] \u538b\u7f29\u5305\u540d\n\u9009\u9879\uff1a\n-d\uff1a\u6307\u5b9a\u89e3\u538b\u7f29\u4f4d\u7f6e\n\u4f8b\u5982\uff1a\n#\u628a\u538b\u7f29\u5305\u89e3\u538b\u5230\u6307\u5b9a\u4f4d\u7f6e\n[root@DevOps test] # unzip 123.zip -d \/root\/test\/<\/code><\/pre>\n<pre><code class=\"language-text\">\u547d\u4ee4\u7684\u683c\u5f0f\u5982\u4e0b\uff1a\n[root@localhost ~ ] # gzip [\u9009\u9879] \u6e90\u6587\u4ef6\n\u9009\u9879\uff1a\n-c\uff1a\u5c06\u538b\u7f29\u6570\u636e\u8f93\u51fa\u5230\u6807\u51c6\u8f93\u51fa\u4e2d\uff0c\u53ef\u4ee5\u7528\u4e8e\u4fdd\u7559\u6e90\u6587\u4ef6\n-d\uff1a\u89e3\u538b\u7f29\n-r\uff1a\u538b\u7f29\u76ee\u5f55\uff08\u4e0d\u4f1a\u628a\u76ee\u5f55\u6253\u5305\uff0c\u53ea\u4f1a\u628a\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u5355\u72ec\u538b\u7f29\uff09<\/code><\/pre>\n<p>2\u3001\u201c.zip\u201d\u683c\u5f0f\u7684\u89e3\u538b\u7f29\u547d\u4ee4  \u201c.zip\u201d\u683c\u5f0f\u7684\u89e3\u538b\u7f29\u547d\u4ee4\u662funzip\uff0c\u5176\u57fa\u672c\u4fe1\u606f\u5982\u4e0b\u3002  \u201c.zip&#8221;\u683c\u5f0f\u5728Linux\u4e0b\u4e0d\u5e38\u7528\uff0c\u8bb0\u4f4f\u4f1a\u7528\u5c31\u597d\u3002\u4e8c\u3001\u201c.gz\u201d\u683c\u5f0f 1\u3001\u201c.gz\u201d\u683c\u5f0f\u7684\u538b\u7f29\u547d\u4ee4  \u201c.gz\u201d\u683c\u5f0f\u662fLinux\u4e2d\u6700\u5e38\u7528\u7684\u538b\u7f29\u683c\u5f0f\uff0c\u4f7f\u7528gzip\u547d\u4ee4\u8fdb\u884c\u538b\u7f29\uff0c\u5176\u57fa\u672c\u4fe1\u606f\u5982\u4e0b\u3002  <\/p>\n<pre><code class=\"language-text\"># \u201d.gz\u201d\u683c\u5f0f\u538b\u7f29\n[root@DevOps test] # ll\n-rw-r--r--. 1 root root     0 1\u6708   9 18:17 abc\n-rw-------. 1 root root     0 1\u6708   9 18:17 def\n[root@DevOps test]# gzip abc\n[root@DevOps test]# ll\n\u603b\u7528\u91cf 4\n-rw-r--r--. 1 root root 24 1\u6708   9 18:17 abc.gz\n-rw-------. 1 root root  0 1\u6708   9 18:17 def\n# \u538b\u7f29\u76ee\u5f55\n[root@DevOps test ] # ll\n\u603b\u7528\u91cf 0\n-rw-r--r--. 1 root root 0 1\u6708  12 00:40 abc\n-rw-------. 1 root root 0 1\u6708   9 18:17 def\n[root@DevOps test ] # cd ..\n[root@DevOps ~ ] # gzip -r test\/\n[root@DevOps ~ ] # ll \/root\/test\/\n\u603b\u7528\u91cf 8\n-rw-r--r--. 1 root root 24 1\u6708  12 00:40 abc.gz\n-rw-------. 1 root root 24 1\u6708   9 18:17 def.gz\n\u6ce8\u610f\uff1a\u4e0d\u4f1a\u628a\u76ee\u5f55\u6253\u5305\uff0c\u53ea\u4f1a\u628a\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u5355\u72ec\u538b\u7f29\u3002\n#\u89e3\u538b\u76ee\u5f55\n[root@DevOps ~ ]# gzip -dr test\/\n[root@DevOps ~ ]# ll \/root\/test\/\n\u603b\u7528\u91cf 0\n-rw-r--r--. 1 root root 0 1\u6708  12 00:40 abc\n-rw-------. 1 root root 0 1\u6708   9 18:17 def\n# \u201d.gz\u201d\u683c\u5f0f\u538b\u7f29\uff0c\u5e76\u4fdd\u7559\u6e90\u6587\u4ef6\uff08\u975e\u5e38\u89c4\u64cd\u4f5c\uff0c\u77e5\u9053\u5c31\u597d\uff09\n[root@localhost ~ ] #gzip -c anaconda-ks.cfg &gt;&gt; anaconda-ks.cfg.gz\n\u63d0\u793a\uff1a&gt;\u4e3a\u8986\u76d6\u5185\u5bb9\uff0c&gt;&gt;\u4e3a\u8ffd\u52a0\u5185\u5bb9\u3002<\/code><\/pre>\n<pre><code class=\"language-text\"> \u4f8b\u5982\uff1a\u4e24\u4e2a\u547d\u4ee4\u90fd\u53ef\u4ee5\u89e3\u538b\u7f29\u201c.gz\u201d\u683c\u5f0f\u7684\u538b\u7f29\u6587\u4ef6\n[root@localhost ~ ]#gunzip install.1og.gz\n[root@localhost ~ ]#gzip -d anaconda-ks.cfg.gz<\/code><\/pre>\n<p>\u7ec3\u4e60\uff1a  \u6ce8\u610f\uff1a  \u4f7f\u7528.gz\u201d\u683c\u5f0f\u538b\u7f29\u6587\u4ef6\u540e\uff0c\u6e90\u6587\u4ef6\u4f1a\u88ab\u5220\u9664\u6389\u3002  \u4f7f\u7528-c\u9009\u9879\uff0c\u4f1a\u628a\u6587\u4ef6\u5185\u5bb9\u538b\u7f29\u4e4b\u540e\u7684\u4e8c\u8fdb\u5236\u6570\u636e\uff0c\u8f93\u51fa\u5230\u5c4f\u5e55\u4e0a\u3002\u800c\u6211\u4eec\u4e0d\u8ba9\u538b\u7f29\u6570\u636e\u8f93\u51fa\u5230\u5c4f\u5e55\u4e0a\uff0c\u800c\u662f\u91cd\u5b9a\u5411\u5230\u538b\u7f29\u6587\u4ef6\u4e2d\uff0c\u8fd9\u6837\u53ef\u4ee5\u5728\u538b\u7f29\u6587\u4ef6\u7684\u540c\u65f6\u4e0d\u5220\u9664\u6e90\u6587\u4ef6 2\u3001\u201cgz\u201d\u683c\u5f0f\u7684\u89e3\u538b\u7f29\u547d\u4ee4  \u5982\u679c\u8981\u89e3\u538b\u7f29\u201cgz\u201d\u683c\u5f0f\uff0c\u90a3\u4e48\u4f7f\u7528\u201cgzip-d\u538b\u7f29\u5305\u201d\u548c\u201cgunzip\u538b\u7f29\u5305\u201d\u547d\u4ee4\u90fd\u53ef\u4ee5\u3002\u6211\u4eec\u5148\u770b\u770bgunzip\u547d\u4ee4\u7684\u57fa\u672c\u4fe1\u606f\u3002  <\/p>\n<pre><code class=\"language-text\">bzip2\u547d\u4ee4\u7684\u683c\u5f0f\u3002\n[rootelocalhost~ ] #bzip2 [\u9009\u9879] \u6e90\u6587\u4ef6\n\u9009\u9879\uff1a\n-d\uff1a\u89e3\u538b\u7f29\n-k\uff1a\u538b\u7f29\u65f6\uff0c\u4fdd\u7559\u6e90\u6587\u4ef6\n-v\uff1a\u663e\u793a\u538b\u7f29\u7684\u8be6\u7ec6\u4fe1\u606f\uff08\u610f\u4e49\u4e0d\u5927\uff0c\u77e5\u9053\u5c31\u884c\uff09\n\u4f8b\u5982\uff1a\n#\u538b\u7f29\u6210.bz2\u683c\u5f0f\uff08\u4e0d\u4fdd\u7559\u6e90\u6587\u4ef6\uff09\n[root@localhost \uff5e] #bzip2 anaconda-ks.cfg\n#\u4fdd\u7559\u6e90\u6587\u4ef6\u538b\u7f29\n[root@localhost \uff5e] #bzip2 -k install.log.syslog<\/code><\/pre>\n<p>\u4e09\u3001\u201c.bz2\u201d\u683c\u5f0f 1\u3001\u201c.bz2\u201d\u683c\u5f0f\u7684\u538b\u7f29\u547d\u4ee4  \u201c.bz2\u201d\u683c\u5f0f\u662fLinux\u7684\u53e6\u4e00\u79cd\u538b\u7f29\u683c\u5f0f\uff0c\u4ece\u7406\u8bba\u4e0a\u6765\u8bb2\uff0c\u201c.bz2\u201d\u683c\u5f0f\u7684\u7b97\u6cd5\u66f4\u5148\u8fdb\u3001\u538b\u7f29\u6bd4\u66f4\u597d\uff1b\u800c\u201c.gz\u201d\u683c\u5f0f\u76f8\u5bf9\u6765\u8bb2\u538b\u7f29\u7684\u65f6\u95f4\u66f4\u5feb\u3002\uff08\u538b\u7f29\u6bd4\u8d8a\u9ad8\uff0c\u538b\u7f29\u7684\u65f6\u5019\u8d8a\u6d88\u8017\u8d44\u6e90\u3002\uff09  \u201c.bz2\u201d\u683c\u5f0f\u7684\u538b\u7f29\u547d\u4ee4\u662fbzip2\uff0c\u547d\u4ee4\u7684\u57fa\u672c\u4fe1\u606f\u5982\u4e0b\u3002  <\/p>\n<pre><code class=\"language-text\"># \u538b\u7f29\u76ee\u5f55\n[root@DevOps ~]# bzip2 test\/\nbzip2: Input file test\/ is a directory.\n[root@DevOps ~]# ll \/root\/test\/\n\u603b\u7528\u91cf 0\n-rw-r--r--. 1 root root 0 1\u6708  12 00:40 abc\n-rw-------. 1 root root 0 1\u6708   9 18:17 def\n\u53d1\u73b0\u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u5e76\u6ca1\u6709\u88ab\u538b\u7f29\u3002\n# \u52a0\u5165-r\u9009\u9879\uff0c\u5219\u4f1a\u76f4\u63a5\u62a5\u9519\uff0c\u5e76\u63d0\u793a\u4f60bzip2 \u547d\u4ee4\u90fd\u6709\u54ea\u4e9b\u9009\u9879\uff0c\u8fd9\u4e9b\u9009\u9879\u4e2d\u4e5f\u6ca1\u6709\u538b\u7f29\u6587\u4ef6\u5939\u7684\u9009\u9879\u3002\n[root@DevOps ~]# bzip2 -r test\/\n\u8bf4\u660e\u201c.bz2\u201d\u538b\u7f29\u683c\u5f0f\uff0c\u4e0d\u80fd\u538b\u7f29\u76ee\u5f55\u3002<\/code><\/pre>\n<pre><code class=\"language-text\">#\u4e24\u4e2a\u547d\u5408\u90fd\u53ef\u4ee5\u89e3\u538b\u7f29\n[root@localhost ~ ] #bunzip2 anaconda-ks.cfg.bz2\n[root@localhost ~ ] #bzip2 -d install.1og.syslog.bz2\n#\u5982\u679c\u89e3\u538b\u540e\u6587\u4ef6\u5b58\u5728\u51b2\u7a81\uff0c\u4f1a\u6709\u63d0\u793a\u3002\u53ef\u5220\u9664\u51b2\u7a81\u6587\u4ef6\uff0c\u5728\u8fdb\u884c\u89e3\u538b\u3002\n[root@localhost ~]# bzip2 -d bed.bz2\nbzip2:Output file bcd already exists.<\/code><\/pre>\n<p>\u6ce8\u610f\uff1a\u201c.bz2\u201d\u538b\u7f29\u683c\u5f0f\u4e0d\u80fd\u591f\u538b\u7f29\u76ee\u5f55\u3002  2\u3001\u201c.bz2\u201d\u683c\u5f0f\u7684\u89e3\u538b\u7f29\u547d\u4ee4  \u201c.bz2\u201d\u683c\u5f0f\u53ef\u4ee5\u4f7f\u7528\u201cbzip2 -d \u538b\u7f29\u5305\u201d\u547d\u4ee4\u6765\u8fdb\u884c\u89e3\u538b\u7f29\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u201cbunzip2\u538b\u7f29\u5305\u201d\u547d\u4ee4\u6765\u8fdb\u884c\u89e3\u538b\u7f29\u3002\u5148\u770b\u770bbunzip2\u547d\u4ee4\u7684\u57fa\u672c\u4fe1\u606f\u3002  <\/p>\n<pre><code class=\"language-text\">\u547d\u4ee4\u7684\u57fa\u672c\u683c\u5f0f\u5982\u4e0b\uff1a\n[root@localhost ~ ] #tar [\u9009\u9879] [-f\u538b\u7f29\u5305\u540d] \u6e90\u6587\u4ef6\u6216\u76ee\u5f55\n\u9009\u9879\uff1a\n-c\uff1a\u6253\u5305\n-f\uff1a\u6307\u5b9a\u538b\u7f29\u5305\u7684\u6587\u4ef6\u540d\u3002\u538b\u7f29\u5305\u7684\u6269\u5c55\u540d\u662f\u7528\u6765\u7ed9\u7ba1\u7406\u5458\u8bc6\u522b\u683c\u5f0f\u7684\uff0c\u6240\u4ee5\u4e00\u5b9a\u8981\u6b63\u786e\u6307\u5b9a\u6269\u5c55\u540d\n-v\uff1a\u663e\u793a\u6253\u5305\u6587\u4ef6\u8fc7\u7a0b\n#\u6253\u5305\uff0c\u4e0d\u4f1a\u538b\u7f29\n[root@localhost ~ ] #tar -cvf anaconda-ks.cfg.tar anaconda-ks.cfg<\/code><\/pre>\n<pre><code class=\"language-text\"># \u6253\u5305123\u76ee\u5f55\u3001abc\u6587\u4ef6\u3001bcd\u6587\u4ef6\u3002\n[root@localhost ~ ]# tar -cvf test.tar 123 abc bcd\n123\/\n123\/hjk\n123\/yui \nabc\nbcd\n\u6ce8\u610f\uff1a\u6253\u5305\u540e\u6e90\u6587\u4ef6\u4e0d\u4f1a\u88ab\u5220\u9664\u3002<\/code><\/pre>\n<pre><code class=\"language-text\">\u547d\u4ee4\u683c\u5f0f\u5982\u4e0b\uff1a\n[root@localhost ~ ] # tar [\u9009\u9879] \u538b\u7f29\u5305\n\u9009\u9879\uff1a\n-x\uff1a\u89e3\u6253\u5305\n-f\uff1a\u6307\u5b9a\u538b\u7f29\u5305\u7684\u6587\u4ef6\u540d-V\uff1a\u663e\u793a\u89e3\u6253\u5305\u6587\u4ef6\u8fc7\u7a0b\n-t\uff1a\u6d4b\u8bd5\uff0c\u5c31\u662f\u4e0d\u89e3\u6253\u5305\uff0c\u53ea\u662f\u67e5\u770b\u5305\u4e2d\u6709\u54ea\u4e9b\u6587\u4ef6\n-C\uff08\u5927\uff09\u76ee\u5f55\uff1a\u6307\u5b9a\u89e3\u6253\u5305\u4f4d\u7f6e<\/code><\/pre>\n<p>\u56db\u3001\u201c.tar\u201d\u683c\u5f0f 1\u3001\u201c.tar\u201d\u683c\u5f0f\u7684\u6253\u5305\u547d\u4ee4  \u201c.tar\u201d\u683c\u5f0f\u7684\u6253\u5305\u548c\u89e3\u6253\u5305\u90fd\u4f7f\u7528tar\u547d\u4ee4\uff0c\u533a\u522b\u53ea\u662f\u9009\u9879\u4e0d\u540c\u3002\u6211\u4eec\u5148\u770b\u770btar\u547d\u4ee4\u7684\u57fa\u672c\u4fe1\u606f\u3002  \u7ec3\u4e60  2\u3001\u201c.tar\u201d\u683c\u5f0f\u7684\u89e3\u6253\u5305\u547d\u4ee4  \u201c.tar\u201d\u683c\u5f0f\u7684\u89e3\u6253\u5305\u4e5f\u9700\u8981\u4f7f\u7528tar\u547d\u4ee4\uff0c\u4f46\u662f\u9009\u9879\u4e0d\u592a\u4e00\u6837\u3002  <\/p>\n<pre><code class=\"language-text\"># \u89e3\u6253\u5305\n[root@localhost ~ ] # rm -rf 123 abc bcd\n[root@localhost ~ ]# tar -xvf test.tar\n123\/\n123\/hjk\n123\/yui \nabc\nbcd<\/code><\/pre>\n<pre><code class=\"language-text\"># \u628a\u4e0a\u8fb9\u6253\u597d\u7684test.tar\u5305\uff0c\u5728\u8fdb\u884c\u538b\u7f29\u3002\n[root@localhost ~ ] # gzip test.tar\n\u5f97\u5230test.tar.gz\u6587\u4ef6\uff0c\u662f\u4e00\u4e2a\u5373\u538b\u7f29\u4e5f\u6253\u5305\u7684\u6587\u4ef6\u3002\n\u5728\u7528test.tar.gz\u6587\u4ef6\u7684\u65f6\u5019\uff0c\u5148\u89e3\u538b\u7f29\u5728\u89e3\u6253\u5305\u3002\n[root@localhost ]# gzip -d test.tar.gz\n[root@localhost ~]# tar -xvf test.tar\n123\/\n123\/hjk\n123\/yui \nabc\nbcd<\/code><\/pre>\n<pre><code class=\"language-text\">\u547d\u4ee4\u683c\u5f0f\u5982\u4e0b\uff1a\n[root@localhost ~ ] # tar [\u9009\u9879] \u538b\u7f29\u5305 \u6e90\u6587\u4ef6\u6216\u76ee\u5f55\n\u9009\u9879\uff1a\n-z\uff1a\u538b\u7f29\u548c\u89e3\u538b\u7f29\".tar.gz\u201d\u683c\u5f0f\n-j\uff1a\u538b\u7f29\u548c\u89e3\u538b\u7f29\".tar.bz2\u201d\u683c\u5f0f<\/code><\/pre>\n<p>\u7ec3\u4e60  \u4e94\u3001\u6253\u5305\u548c\u538b\u7f29\u7684\u5173\u7cfb  \u5148\u628a\u9700\u8981\u7684\u6587\u4ef6\u8fdb\u884c\u6253\u5305\uff0c\u7136\u540e\u628a\u6253\u597d\u7684\u5305\u518d\u8fdb\u884c\u538b\u7f29\u3002  \u8fd9\u6837\u662f\u4e0d\u662f\u7528\u7740\u5f88\u9ebb\u70e6\uff0c\u5176\u5b9e\u4e0d\u7528\u62c5\u5fc3\uff0c\u6211\u4eec\u4e0b\u8fb9\u4f1a\u6709\u76f4\u63a5\u538b\u7f29\u6253\u5305\u548c\u89e3\u538b\u7f29\u89e3\u6253\u5305\u7684\u547d\u4ee4\u3002  \u8fd9\u91cc\u4e3b\u8981\u662f\u544a\u8bc9Linux\u7cfb\u7edf\u4e2d\u538b\u7f29\u548c\u6253\u5305\u662f\u4e24\u4e2a\u547d\u4ee4\u3002  \u516d\u3001\u201c.tar.gz\u201d\u548c\u201c.tar.bz2\u201d\u683c\u5f0f1\u3001\u4f7f\u7528tar\u547d\u4ee4\u76f4\u63a5\u6253\u5305\u538b\u7f29\u3002  <\/p>\n<pre><code class=\"language-text\">#\u628a123\u76ee\u5f55\u3001abc\u6587\u4ef6\u3001bcd\u6587\u4ef6\uff0c\u76f4\u63a5\u6253\u5305\u538b\u7f29\u4e3a\u201d.tar.bz2\u201c\u683c\u5f0f\u6587\u4ef6\n[root@localhost ~] # tar -jcvf test.tar.bz2 123 abc bcd\n123\/\n123\/hjk\n123\/yui \nabc\nbed\n\u5f97\u5230test.tar.bz2\u6587\u4ef6\u3002\n\u89e3\u538b\u7f29\uff0c\u5148\u628a\u6e90\u6587\u4ef6\u5220\u9664\u6389\uff0c\u518d\u89e3\u538b\n[root@localhost ~ ] # rm -rf 123 abc bcd\n[root@localhost ~ ] # tar -jxvf test.tar.bz2\n123\/\n123\/hjk\n123\/yui \nabc\nbcd<\/code><\/pre>\n<pre><code class=\"language-text\">#\u628a123\u76ee\u5f55\u3001abc\u6587\u4ef6\u3001bcd\u6587\u4ef6\uff0c\u76f4\u63a5\u6253\u5305\u538b\u7f29\u4e3a\u201ctar.gz\u201d\u683c\u5f0f\u6587\u4ef6\n[root@localhost ~] # tar -zcvf test.tar.gz 123 abc bcd\n123\/\n123\/hjk\n123\/yui \nabc\nbed\n\u5f97\u5230test.tar.gz\u6587\u4ef6\u3002\n\u89e3\u538b\u7f29\uff0c\u5148\u628a\u6e90\u6587\u4ef6\u5220\u9664\u6389\uff0c\u518d\u89e3\u538b\n[root@localhost ~ ] # rm -rf 123 abc bcd\n[root@localhost ~ ] # tar -zxvf test.tar.gz\n123\/\n123\/hjk\n123\/yui \nabc\nbcd<\/code><\/pre>\n<pre><code class=\"language-text\">[root@localhost \uff5e] # tar -ztvf test.tar.gz\ndrwxr-xr-x root\/root 02017-02-1714:44123\/\n-rw-r--r--root\/root 02017-02-1714:41123\/hjk\n-rw-r--r--root\/root02017-02-1714:41123\/yui\n-rw-r--r--root\/root 1122017-02-17 09:16 abc\n-rw-r--r--root\/root 02017-02-17 14:44 bcd<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/www.ccwifi.cc\/blogs\/wp-content\/uploads\/2024\/03\/1710410777901_0.jpg\" alt=\"kali\u6253\u5f00\u6587\u4ef6\u7684\u547d\u4ee4\"><\/p>\n<p>2\u3001\u7ec3\u4e60\uff1a\u201d.tar.bz2\u201c\u683c\u5f0f  3\u3001\u201ctar.gz\u201d\u683c\u5f0f  4\u3001\u6269\u5c55\u5e38\u7528\u65b9\u5f0f  \u53ea\u67e5\u770b\u4e0d\u89e3\u538b  \u7528\u957f\u683c\u5f0f\u663e\u793a\u4e86\u5305\u4e2d\u6240\u6709\u7684\u6587\u4ef6\u548c\u6587\u4ef6\u5939\u3002  \u4e5f\u5c31\u662f\u628a\u9009\u9879\u4e2d\u7684c\u53d8\u6210t\u3002-jtvf\u540c\u7406\u3002  \u89e3\u538b\u7f29\u5230\u6307\u5b9a\u4f4d\u7f6e  [root@localhost \uff5e] # tar -zxvf test.tar.gz -C \/tmp  \u6ce8\u610f\uff1a-C \/tmp\u4e00\u5b9a\u8981\u8ddf\u5728\u89e3\u538b\u7f29\u5305\u7684\u540e\u8fb9\uff0c\u4e0d\u7136\u4f1a\u4fdd\u5b58\u3002  \u53ea\u89e3\u538b\u538b\u7f29\u5305\u4e2d\u7684\u7279\u5b9a\u6587\u4ef6\uff0c\u5230\u6307\u5b9a\u4f4d\u7f6e  [root@localhost ~ ] # tar -zxvf test.tar.gz -C\/tmp 123\/hjk  \u6211\u4eec\u5de5\u4f5c\u4e2d\u5e38\u7528\u7684\u538b\u7f29\u548c\u89e3\u538b\u7f29\u547d\u4ee4\uff0c\u4e3b\u8981\u662f\u516d\u4e2d\u6240\u8bb2\u7684\u3002  \u91cd\u70b9\uff1a\u914d\u5957\u5b66\u4e60\u8d44\u6599\u548c\u89c6\u9891\u6559\u5b66  \u90a3\u4e48\u5728\u8fd9\u91cc\u6211\u4e5f\u7cbe\u5fc3\u51c6\u5907\u4e86\u4e0a\u8ff0\u5927\u7eb2\u7684\u8be6\u7ec6\u8d44\u6599\u5728\u4e0b\u65b9\u94fe\u63a5\u5982\u4e0b  <\/p>\n<p><!-- \u6587\u7ae0\u6765\u6e90:https:\/\/zhuanlan.zhihu.com\/p\/551385080 --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u5e38\u7528\u547d\u4ee4\u2014\u2014\u538b\u7f29\u548c\u89e3\u538b\u7f29\u547d\u4ee4\u4e4b\u524d\u8bf4\u8fc7\uff0c\u5728Linux\u7cfb\u7edf\u4e0b\uff0c\u6587\u4ef6\u662f\u4e0d\u533a\u5206\u6269\u5c55\u540d\u7684\u3002\u4f46\u662fLinux\u7cfb\u7edf\u652f\u6301\u5f88\u591a\u79cd\u538b\u7f29\u683c\u5f0f\uff0c\u5982\u679c\u538b\u7f29\u6587\u4ef6\u4e0d\u5199\u4e0a\u6269\u5c55\u540d\uff0c\u4f60\u81ea\u5df1\u521b\u5efa\u7684\u538b\u7f29\u6587\u4ef6\u53ef\u80fd\u4f60\u81ea\u5df1\u77e5\u9053\uff0c\u4f46\u662f\u8fc7\u4e00\u9635\u4f60\u53ef\u80fd\u4e5f\u5fd8\u8bb0\u4e86\u3002<\/p>\n","protected":false},"author":1,"featured_media":593,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-592","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts\/592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/comments?post=592"}],"version-history":[{"count":0,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts\/592\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/media\/593"}],"wp:attachment":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/media?parent=592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/categories?post=592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/tags?post=592"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/topic?post=592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}