{"id":744,"date":"2019-04-25T11:28:43","date_gmt":"2019-04-25T03:28:43","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=744"},"modified":"2022-05-03T20:19:55","modified_gmt":"2022-05-03T12:19:55","slug":"zip","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/zip","title":{"rendered":"zip\u547d\u4ee4 – \u538b\u7f29\u6587\u4ef6"},"content":{"rendered":"\n

zip\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u538b\u7f29\u6587\u4ef6\uff0c\u89e3\u538b\u547d\u4ee4\u4e3aunzip\u3002\u901a\u8fc7zip\u547d\u4ee4\u53ef\u4ee5\u5c06\u6587\u4ef6\u6253\u5305\u6210.zip\u683c\u5f0f\u7684\u538b\u7f29\u5305\uff0c\u91cc\u9762\u4f1a\u9644\u542b\u6587\u4ef6\u7684\u540d\u79f0\u3001\u8def\u5f84\u3001\u521b\u5efa\u65f6\u95f4\u3001\u4e0a\u6b21\u4fee\u6539\u65f6\u95f4\u7b49\u7b49\u4fe1\u606f\uff0c\u4e0etar\u547d\u4ee4\u76f8\u4f3c\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>zip \u53c2\u6570 \u6587\u4ef6<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-q<\/td>\u4e0d\u663e\u793a\u6307\u4ee4\u6267\u884c\u8fc7\u7a0b <\/td><\/tr>
-r<\/td>\u9012\u5f52\u5904\u7406\uff0c\u5c06\u6307\u5b9a\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u548c\u5b50\u76ee\u5f55\u4e00\u5e76\u5904\u7406 <\/td><\/tr>
-z<\/td>\u66ff\u538b\u7f29\u6587\u4ef6\u52a0\u4e0a\u6ce8\u91ca <\/td><\/tr>
-v<\/td>\u663e\u793a\u6307\u4ee4\u6267\u884c\u8fc7\u7a0b\u6216\u663e\u793a\u7248\u672c\u4fe1\u606f <\/td><\/tr>
-d<\/td>\u66f4\u65b0\u538b\u7f29\u5305\u5185\u6587\u4ef6<\/td><\/tr>
-n<\u5b57\u5c3e\u5b57\u7b26\u4e32> <\/td>\u4e0d\u538b\u7f29\u5177\u6709\u7279\u5b9a\u5b57\u5c3e\u5b57\u7b26\u4e32\u7684\u6587\u4ef6 <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u5c06\u6307\u5b9a\u76ee\u5f55\u53ca\u5176\u5185\u5168\u90e8\u6587\u4ef6\u90fd\u6253\u5305\u6210zip\u683c\u5f0f\u538b\u7f29\u5305\u6587\u4ef6\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# zip -r backup1.zip \/etc\r\n  adding: etc\/fstab (deflated 45%)\r\n  adding: etc\/crypttab (stored 0%)\n  adding: etc\/resolv.conf (stored 0%)\r\n  adding: etc\/dnf\/ (stored 0%)\r\n  adding: etc\/dnf\/modules.d\/ (stored 0%)\r\n  adding: etc\/dnf\/modules.d\/container-tools.module (deflated 17%)\r\n  adding: etc\/dnf\/modules.d\/llvm-toolset.module (deflated 14%)\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n\n\n\n

\u5c06\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55\u5185\u6240\u6709\u4ee5.cfg\u4e3a\u540e\u7f00\u7684\u6587\u4ef6\u6253\u5305\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# zip -r backup2.zip *.cfg\r\n  adding: anaconda-ks.cfg (deflated 44%)\r\n  adding: initial-setup-ks.cfg (deflated 44%)\r<\/pre>\n\n\n\n

\u66f4\u65b0\u538b\u7f29\u5305\u6587\u4ef6\u4e2d\u67d0\u4e2a\u6587\u4ef6\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# zip -dv backup2.zip anaconda-ks.cfg \r\n1>1: updating: anaconda-ks.cfg (deflated 44%)\r<\/pre>\n","protected":false},"excerpt":{"rendered":"

zip\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u538b\u7f29\u6587\u4ef6\uff0c\u89e3\u538b\u547d\u4ee4\u4e3aunzip\u3002\u901a\u8fc7zip\u547d\u4ee4\u53ef\u4ee5\u5c06\u6587\u4ef6\u6253\u5305\u6210.zip\u683c\u5f0f\u7684\u538b\u7f29\u5305\uff0c\u91cc\u9762 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/744"}],"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=744"}],"version-history":[{"count":4,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/744\/revisions"}],"predecessor-version":[{"id":9176,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/744\/revisions\/9176"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}