{"id":289805,"date":"2024-02-04T05:10:18","date_gmt":"2024-02-03T21:10:18","guid":{"rendered":"https:\/\/lrxjmw.cn\/lsqystwjyzg.html"},"modified":"2024-02-04T05:10:18","modified_gmt":"2024-02-03T21:10:18","slug":"lsqystwjyzg","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lsqystwjyzg.html","title":{"rendered":"Linux\u795e\u5668\uff1a\u538b\u7f29.tgz\u6587\u4ef6\uff0c\u4e00\u62dbget"},"content":{"rendered":"

\u6211\u4eec\u5e38\u5e38\u5728Linux<\/a>\u7cfb\u7edf<\/a>\u4e2d\u4f7f\u7528\u538b\u7f29\u5305\uff0c\u7279\u522b\u662f.tgz\u683c\u5f0f\u7684\u538b\u7f29\u5305\u3002\u4e3a\u4e86\u7ed9\u60a8\u63d0\u4f9b\u66f4\u8d34\u5207\u7684\u538b\u7f29\u5efa\u8bae\uff0c\u672c\u6587\u5c06\u8bc4\u6d4b\u591a\u79cd\u5e38\u89c1\u7684Linux\u4e0b\u538b\u7f29\u6210.tgz\u683c\u5f0f\u7684\u65b9\u6cd5\u3002<\/p>\n

1.\u4f7f\u7528tar\u547d\u4ee4<\/a>\u538b\u7f29\u4e3a.tgz\u683c\u5f0f<\/b><\/p>\n

\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e2dlinux\u7a7a\u95f4\uff0ctar\u547d\u4ee4\u53ef\u662f\u4e2a\u5927\u6709\u7528\u5904\u7684\u6587\u4ef6\u6253\u5305\u4e0e\u538b\u7f29\u795e\u5668\u54e6\uff01\u4e0b\u9762\u8fd9\u4e2a\u7b80\u5355\u547d\u4ee4\u5c31\u662f\u628a\u4f60\u9700\u8981\u7684\u6587\u4ef6\u5939\u6216\u6587\u4ef6\u6210\u529f\u5730\u538b\u7f29\u6210.tgz\u8fd9\u79cd\u4e13\u4e1a\u683c\u5f0f\u5566\uff5e<\/p>\n

\n

\ntar -czvf file.tgz folder\/\n\u6b64\u6cd5\u7b80\u4fbf\u76f4\u89c2\uff0c\u4f46\u9700\u719f\u8bb0TAR\u6307\u4ee4\u4e4b\u5404\u53c2\u6570\u4e0e\u9009\u9879\u54e6\uff0c\u5bf9\u65b0\u4eba\u6765\u8bf4\u6216\u8bb8\u6709\u4e9b\u6311\u6218\u54e6\u3002\n2.\u4f7f\u7528gzip\u548ctar\u8054\u5408\u538b\u7f29\u4e3a.tgz\u683c\u5f0f<\/b>\n\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u6211\u4eec\u4e5f\u5e38\u4f1a\u7528\u5230\u79f0\u4e4b\u4e3agzip\u7684\u538b\u7f29\u5de5\u5177\u3002\u5b83\u4e0etar\u643a\u624b\uff0c\u4fbf\u80fd\u8f7b\u677e\u5c06\u6587\u4ef6\u6216\u6587\u4ef6\u5939\u6253\u5305\u6210.tgz\u683c\u5f0f\u3002\u4e0b\u9762\u6211\u6765\u8be6\u7ec6\u4ecb\u7ecd\u4e00\u4e0b\u64cd\u4f5c\u6b65\u9aa4\uff1a\n1.\u5148\u4f7f\u7528tar\u547d\u4ee4\u5c06\u6587\u4ef6\u5939\u6216\u8005\u6587\u4ef6\u6253\u5305\u6210.tar\u683c\u5f0f\uff1a\ntar -cvf file.tar folder\/\n\u63a5\u4e0b\u6765\uff0c\u8bf7\u4f7f\u7528\u6211\u4eec\u7684gzip\u5de5\u5177\uff0c\u628a\u60a8\u539f\u59cb\u7684.tar\u6587\u4ef6\u6253\u5305\u4e3a\u66f4\u52a0\u9ad8\u6548\u7684.tgz\u683c\u5f0f\uff1a\ngzip file.tar\n\u8fd9\u79cd\u65b9\u5f0f\u867d\u7136\u6bd4\u76f4\u63a5\u7528tar\u547d\u4ee4\u591a\u4e86\u4e24\u6b65\u64cd\u4f5c\uff0c\u4f46\u5bf9\u4e8e\u719f\u4e60linux\u6307\u4ee4\u7684\u670b\u53cb\u4eec\u800c\u8a00\uff0c\u4e5f\u5e76\u975e\u96be\u5ea6\u91cd\u91cd\u3002\n3.\u4f7f\u75287-Zip\u538b\u7f29\u4e3a.tgz\u683c\u5f0f<\/b>\n\u9664\u4e86\u57fa\u672c\u7684Linux\u81ea\u5e26\u538b\u7f29\u7a0b\u5e8f\u5916\uff0c\u60a8\u8fd8\u53ef\u4f7f\u7528\u5176\u4ed6\u7b2c\u4e09\u65b9\u5e94\u7528\u6765\u5c06\u6587\u4ef6\u6216\u6587\u4ef6\u5939\u6253\u5305\u6210.tgz\u683c\u5f0f\u3002\u4f8b\u5982\uff0c\u4e03 Zip\u5c31\u662f\u4e00\u6b3e\u5f3a\u5927\u4e14\u9002\u7528\u5e7f\u6cdb\u7684\u8de8\u5e73\u53f0\u538b\u7f29\u5de5\u5177\u3002\u4ee5\u4e0b\u662f\u64cd\u4f5c\u529e\u6cd5\uff1a\n\u9996\u5148\u8bf7\u60a8\u6309\u7167\u81ea\u5df1\u7684\u64cd\u4f5c\u7cfb\u7edf\u7248\u672c\uff0c\u9009\u62e9\u6070\u5f53\u7684\u9014\u5f84\u8fdb\u884c7-Zip\u7684\u5b89\u88c5\u3002\n2.\u5728\u7ec8\u7aef\u4e2d\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u538b\u7f29\uff1a\n7z a -ttar file.tar folder\/\n\u6b64\u65b9\u6848\u6bd4\u4e4b\u524d\u4e24\u79cd\u9700\u6dfb\u88c5\u4e13\u7528\u8f6f\u4f53\uff0c\u4f46\u529f\u80fd\u548c\u6548\u80fd\u4e0a\u90fd\u66f4\u52a0\u51fa\u8272\u3002\n4.\u4f7f\u7528Python\u811a\u672c\u538b\u7f29\u4e3a.tgz\u683c\u5f0f<\/b>\n\u5047\u5982\u60a8\u7cbe\u901aPython\u7f16\u7801\uff0c\u90a3\u4e48\u5229\u7528\u811a\u672c\u4fbf\u53ef\u8f7b\u677e\u5730\u5b9e\u73b0\u5bf9\u6587\u4ef6\u5939\u6216\u6587\u4ef6\u7684\u6253\u5305\u538b\u7f29\uff08\u683c\u5f0f\u4e3a.tgz\uff09\u3002\u8fd9\u91cc\u7ed9\u60a8\u63d0\u4f9b\u4e00\u6bb5\u7b80\u4fbf\u6613\u61c2\u7684\u6837\u677f\u4ee3\u7801\uff1a\n<\/pre>\n

python<\/p>\n

linux\u538b\u7f29\u4e3azip_linux\u4e0b\u538b\u7f29\u4e3a.tgz_linux\u538b\u7f29\u6587\u4ef6.gz<\/p>\n

import tarfile<\/p>\n

\u656c\u8bf7\u4f7f\u7528\u538b\u7f29\u6587\u4ef6\u5939\u529f\u80fd\uff0c\u4ee5\u63d0\u9ad8\u5b58\u50a8\u7a7a\u95f4\u7684\u5229\u7528\u7387\u3002\u4ee5\u4e0b\u662f\u76f8\u5173\u6b65\u9aa4linux\u4e0b\u538b\u7f29\u4e3a.tgz<\/strong>\uff0c\u8bf7\u6ce8\u610f\u5728\u5904\u7406\u4efb\u4f55\u6587\u4ef6\u65f6\u52a1\u5fc5\u8c28\u614e\u64cd\u4f5c\uff1a<\/p>\n

linux\u538b\u7f29\u6587\u4ef6.gz_linux\u538b\u7f29\u4e3azip_linux\u4e0b\u538b\u7f29\u4e3a.tgz<\/p>\n

\u4eb2\u7231\u7684\u7528\u6237\uff0c\u6211\u4eec\u5229\u7528tarfile\u65b9\u4fbf\u5730\u6253\u5f00\u4e86\"\u8f93\u51fa\"\u6587\u4ef6\uff0c\u5e76\u4ee5\u538b\u7f29\u683c\u5f0f\"gzip\"\u5199\u5165\u3002<\/p>\n

tar.add(folder)<\/p>\n

linux\u538b\u7f29\u4e3azip_linux\u4e0b\u538b\u7f29\u4e3a.tgz_linux\u538b\u7f29\u6587\u4ef6.gz<\/p>\n

\u8bf7\u4f7f\u7528\u538b\u7f29\u5de5\u5177\u5bf9\"\u6587\u4ef6\u5939\/\"\u4e2d\u7684\u6240\u6709\u6587\u4ef6\u8fdb\u884c\u6253\u5305\uff0c\u751f\u6210\u540d\u4e3a\"file.tgz\"\u7684\u538b\u7f29\u6587\u4ef6\u3002<\/p>\n

\u867d\u7136\u6b64\u6cd5\u9700\u7f16\u7a0b\u57fa\u7840\uff0c\u4f46\u60a8\u53ef\u6309\u81ea\u8eab\u6240\u9700\u81ea\u7531\u8c03\u6574\u3002<\/p>\n

5.\u4f7f\u7528\u56fe\u5f62\u754c\u9762\u5de5\u5177\u538b\u7f29\u4e3a.tgz\u683c\u5f0f<\/b><\/p>\n

\u82e5\u60a8\u5bf9\u547d\u4ee4\u884c\u64cd\u4f5c\u4e0d\u592a\u719f\u6089\uff0c\u4e5f\u53ef\u9009\u62e9\u4f7f\u7528\u4e00\u4e9b\u6613\u4e8e\u64cd\u4f5c\u7684\u56fe\u5f62\u754c\u9762\u5de5\u5177\u6765\u5b8c\u6210\u6587\u4ef6\u538b\u7f29\u5de5\u4f5c\u54e6\uff01\u5982\u6211\u4eec\u719f\u77e5\u7684File Roller\u548cArk\u5c31\u652f\u6301\u5c06\u6587\u4ef6\u6216\u6587\u4ef6\u5939\u538b\u7f29\u6210\u4e3a.tgz\u683c\u5f0f\u3002<\/p>\n

\u603b\u7684\u6765\u8bf4\uff0cLinux\u7cfb\u7edf\u4e2d\u538b\u7f29\u6210.tgz\u683c\u5f0f\u7684\u65b9\u6cd5\u5f88\u591a\uff0c\u5404\u6709\u6240\u957f\u3002\u5bf9\u4e8e\u65b0\u624b\u7528\u6237\u800c\u8a00\uff0c\u6211\u4eec\u63a8\u8350\u60a8\u4f18\u5148\u4f7f\u7528tar\u547d\u4ee4\u6765\u5b8c\u6210\u538b\u7f29\uff1b\u82e5\u5bf9\u547d\u4ee4\u884c\u64cd\u4f5c\u9a7e\u8f7b\u5c31\u719f\uff0c\u90a3\u4e48gzip\u548ctar\u8054\u5408\u538b\u7f29\u4e5f\u662f\u4e0d\u9519\u7684\u9009\u62e9\uff1b\u82e5\u662f\u8ffd\u6c42\u66f4\u9ad8\u7684\u529f\u80fd\u4e0e\u6548\u7387\uff0c\u4e0d\u59a8\u8bd5\u8bd5\u770b7-Zip\uff1b\u5f53\u7136\uff0c\u5047\u5982\u60a8\u7cbe\u901aPython\u7b49\u7f16\u7a0b\u8bed\u8a00linux \u8f6f\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u81ea\u5b9a\u4e49\u811a\u672c\u4ee5\u6ee1\u8db3\u81ea\u5df1\u7684\u538b\u7f29\u9700\u6c42\uff1b\u800c\u5982\u679c\u60a8\u504f\u7231\u56fe\u5f62\u754c\u9762\u64cd\u4f5clinux\u4e0b\u538b\u7f29\u4e3a.tgz<\/strong>\uff0c\u90a3\u4e48\u5bf9\u5e94\u7684\u5de5\u5177\u5e94\u8be5\u80fd\u6ee1\u8db3\u60a8\u7684\u6240\u6709\u8981\u6c42\u3002\u671f\u5f85\u8fd9\u7bc7\u6587\u7ae0\u80fd\u7ed9\u5927\u5bb6\u5728Linux\u73af\u5883\u4e0b\u7684\u6587\u4ef6\u538b\u7f29\u5e26\u6765\u5b9e\u8d28\u6027\u7684\u5e2e\u52a9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

tgz\u683c\u5f0f\u7684\u538b\u7f29\u5305\u3002\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0ctar\u547d\u4ee4\u53ef\u662f\u4e2a\u5927\u6709\u7528\u5904\u7684\u6587\u4ef6\u6253\u5305\u4e0e\u538b\u7f29\u795e\u5668\u54e6\uff01\u5047\u5982\u60a8\u7cbe\u901aPython\u7f16\u7801\uff0c\u90a3\u4e48\u5229\u7528\u811a\u672c\u4fbf\u53ef\u8f7b\u677e\u5730\u5b9e\u73b0\u5bf9\u6587\u4ef6\u5939\u6216\u6587\u4ef6\u7684\u6253\u5305\u538b\u7f29\uff08\u683c\u5f0f\u4e3a.\u4eb2\u7231\u7684\u7528\u6237\uff0c\u6211\u4eec\u5229\u7528tarfile\u65b9\u4fbf\u5730\u6253\u5f00\u4e86\u8f93\u51fa\u6587\u4ef6\uff0c\u5e76\u4ee5\u538b\u7f29\u683c\u5f0fgzip\u5199\u5165\u3002<\/p>\n","protected":false},"author":1,"featured_media":289806,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-289805","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/289805","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=289805"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/289805\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/289806"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=289805"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=289805"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=289805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}