{"id":2247,"date":"2019-05-29T00:06:12","date_gmt":"2019-05-28T16:06:12","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=2247"},"modified":"2019-05-30T21:31:42","modified_gmt":"2019-05-30T13:31:42","slug":"patch","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/patch","title":{"rendered":"patch\u547d\u4ee4 – \u4fee\u8865\u6587\u4ef6"},"content":{"rendered":"\n
patch\u547d\u4ee4\u8ba9\u7528\u6237\u5229\u7528\u8bbe\u7f6e\u4fee\u8865\u6587\u4ef6\u7684\u65b9\u5f0f\uff0c\u4fee\u6539\uff0c\u66f4\u65b0\u539f\u59cb\u6587\u4ef6\u3002\u5018\u82e5\u4e00\u6b21\u4ec5\u4fee\u6539\u4e00\u4e2a\u6587\u4ef6\uff0c\u53ef\u76f4\u63a5\u5728\u6307\u4ee4\u5217\u4e2d\u4e0b\u8fbe\u6307\u4ee4\u4f9d\u5e8f\u6267\u884c\u3002\u5982\u679c\u914d\u5408\u4fee\u8865\u6587\u4ef6\u7684\u65b9\u5f0f\u5219\u80fd\u4e00\u6b21\u4fee\u8865\u5927\u6279\u6587\u4ef6\uff0c\u8fd9\u4e5f\u662fLinux\u7cfb\u7edf\u6838\u5fc3\u7684\u5347\u7ea7\u65b9\u6cd5\u4e4b\u4e00 \u3002<\/p>\n\n\n\n
\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>patch [\u53c2\u6570] <\/p>\n\n\n\n \u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n \u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n \u4f7f\u7528patch\u6307\u4ee4\u5c06\u6587\u4ef6”file1″\u5347\u7ea7\uff0c\u5176\u5347\u7ea7\u8865\u4e01\u6587\u4ef6\u4e3a”file.patch”\uff1a<\/p>\n\n\n\n \u4f7f\u7528patch\u6765\u5e94\u7528\u8865\u4e01\uff1a<\/p>\n\n\n\n patch\u547d\u4ee4\u8ba9\u7528\u6237\u5229\u7528\u8bbe\u7f6e\u4fee\u8865\u6587\u4ef6\u7684\u65b9\u5f0f\uff0c\u4fee\u6539\uff0c\u66f4\u65b0\u539f\u59cb\u6587\u4ef6\u3002\u5018\u82e5\u4e00\u6b21\u4ec5\u4fee\u6539\u4e00\u4e2a\u6587\u4ef6\uff0c\u53ef\u76f4\u63a5\u5728\u6307\u4ee4\u5217\u4e2d\u4e0b\u8fbe\u6307 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/2247"}],"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=2247"}],"version-history":[{"count":10,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/2247\/revisions"}],"predecessor-version":[{"id":2967,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/2247\/revisions\/2967"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=2247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=2247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=2247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}-b <\/td> \u5907\u4efd\u6bcf\u4e00\u4e2a\u539f\u59cb\u6587\u4ef6 <\/td><\/tr> -B\u3000<\/td> \u8bbe\u7f6e\u6587\u4ef6\u5907\u4efd\u65f6\uff0c\u9644\u52a0\u5728\u6587\u4ef6\u540d\u79f0\u524d\u9762\u7684\u5b57\u9996\u5b57\u7b26\u4e32\uff0c\u8be5\u5b57\u7b26\u4e32\u53ef\u4ee5\u662f\u8def\u5f84\u540d\u79f0 <\/td><\/tr> -c <\/td> \u628a\u4fee\u8865\u6570\u636e\u89e3\u8bd1\u6210\u5173\u8054\u6027\u7684\u5dee\u5f02 <\/td><\/tr> -d <\/td> \u8bbe\u7f6e\u5de5\u4f5c\u76ee\u5f55 <\/td><\/tr> -D<\/td> \u7528\u6307\u5b9a\u7684\u7b26\u53f7\u628a\u6539\u53d8\u7684\u5730\u65b9\u6807\u793a\u51fa\u6765 <\/td><\/tr> -e <\/td> \u628a\u4fee\u8865\u6570\u636e\u89e3\u8bd1\u6210ed\u6307\u4ee4\u53ef\u7528\u7684\u53d9\u8ff0\u6587\u4ef6 <\/td><\/tr> -E <\/td> \u82e5\u4fee\u8865\u8fc7\u540e\u8f93\u51fa\u7684\u6587\u4ef6\u5176\u5185\u5bb9\u662f\u4e00\u7247\u7a7a\u767d\uff0c\u5219\u79fb\u9664\u8be5\u6587\u4ef6 <\/td><\/tr> -f <\/td> \u6b64\u53c2\u6570\u7684\u6548\u679c\u548c\u6307\u5b9a”-t”\u53c2\u6570\u7c7b\u4f3c\uff0c\u4f46\u4f1a\u5047\u8bbe\u4fee\u8865\u6570\u636e\u7684\u7248\u672c\u4e3a\u65b0\u7248\u672c <\/td><\/tr> -F <\/td> \u8bbe\u7f6e\u76d1\u522b\u5217\u6570\u7684\u6700\u5927\u503c <\/td><\/tr> -g <\/td> \u8bbe\u7f6e\u4ee5RSC\u6216SCCS\u63a7\u5236\u4fee\u8865\u4f5c\u4e1a <\/td><\/tr> -i<\/td> \u8bfb\u53d6\u6307\u5b9a\u7684\u4fee\u8865\u6587\u4ef6 <\/td><\/tr> -l <\/td> \u5ffd\u7565\u4fee\u8865\u6570\u636e\u4e0e\u8f93\u5165\u6570\u636e\u7684\u8df3\u683c\uff0c\u7a7a\u683c\u5b57\u7b26 <\/td><\/tr> -n <\/td> \u628a\u4fee\u8865\u6570\u636e\u89e3\u8bd1\u6210\u4e00\u822c\u6027\u7684\u5dee\u5f02 <\/td><\/tr> -N <\/td> \u5ffd\u7565\u4fee\u8865\u7684\u6570\u636e\u8f83\u539f\u59cb\u6587\u4ef6\u7684\u7248\u672c\u66f4\u65e7\uff0c\u6216\u8be5\u7248\u672c\u7684\u4fee\u8865\u6570\u636e\u5df2\u4f7f\u3000\u7528\u8fc7 <\/td><\/tr> -o<\/td> \u8bbe\u7f6e\u8f93\u51fa\u6587\u4ef6\u7684\u540d\u79f0\uff0c\u4fee\u8865\u8fc7\u7684\u6587\u4ef6\u4f1a\u4ee5\u8be5\u540d\u79f0\u5b58\u653e <\/td><\/tr> -p<\/td> \u8bbe\u7f6e\u6b32\u5265\u79bb\u51e0\u5c42\u8def\u5f84\u540d\u79f0 <\/td><\/tr> -f<\/td> \u8bbe\u7f6e\u4fdd\u5b58\u62d2\u7edd\u4fee\u8865\u76f8\u5173\u4fe1\u606f\u7684\u6587\u4ef6\u540d\u79f0\uff0c\u9884\u8bbe\u7684\u6587\u4ef6\u540d\u79f0\u4e3a.rej <\/td><\/tr> -R <\/td> \u5047\u8bbe\u4fee\u8865\u6570\u636e\u662f\u7531\u65b0\u65e7\u6587\u4ef6\u4ea4\u6362\u4f4d\u7f6e\u800c\u4ea7\u751f <\/td><\/tr> -s <\/td> \u4e0d\u663e\u793a\u6307\u4ee4\u6267\u884c\u8fc7\u7a0b\uff0c\u9664\u975e\u53d1\u751f\u9519\u8bef <\/td><\/tr> -t <\/td> \u81ea\u52a8\u7565\u8fc7\u9519\u8bef\uff0c\u4e0d\u8be2\u95ee\u4efb\u4f55\u95ee\u9898 <\/td><\/tr> -T <\/td> \u6b64\u53c2\u6570\u7684\u6548\u679c\u548c\u6307\u5b9a”-Z”\u53c2\u6570\u7c7b\u4f3c\uff0c\u4f46\u4ee5\u672c\u5730\u65f6\u95f4\u4e3a\u4e3b <\/td><\/tr> -u <\/td> \u628a\u4fee\u8865\u6570\u636e\u89e3\u8bd1\u6210\u4e00\u81f4\u5316\u7684\u5dee\u5f02 <\/td><\/tr> -v <\/td> \u663e\u793a\u7248\u672c\u4fe1\u606f <\/td><\/tr> -V<\/td> \u7528”-b”\u53c2\u6570\u5907\u4efd\u76ee\u6807\u6587\u4ef6\u540e\uff0c\u5907\u4efd\u6587\u4ef6\u7684\u5b57\u5c3e\u4f1a\u88ab\u52a0\u4e0a\u4e00\u4e2a\u5907\u4efd\u5b57\u7b26\u4e32\uff0c\u8fd9\u4e2a\u5b57\u7b26\u4e32\u4e0d\u4ec5\u53ef\u7528”-z”\u53c2\u6570\u53d8\u66f4\uff0c\u5f53\u4f7f\u7528”-V”\u53c2\u6570\u6307\u5b9a\u4e0d\u540c\u5907\u4efd\u65b9\u5f0f\u65f6\uff0c\u4e5f\u4f1a\u4ea7\u751f\u4e0d\u540c\u5b57\u5c3e\u7684\u5907\u4efd\u5b57\u7b26\u4e32 <\/td><\/tr> -Y<\/td> \u8bbe\u7f6e\u6587\u4ef6\u5907\u4efd\u65f6\uff0c\u9644\u52a0\u5728\u6587\u4ef6\u57fa\u672c\u540d\u79f0\u5f00\u5934\u7684\u5b57\u9996\u5b57\u7b26\u4e32 <\/td><\/tr> -z <\/td> \u6b64\u53c2\u6570\u7684\u6548\u679c\u548c\u6307\u5b9a”-B”\u53c2\u6570\u7c7b\u4f3c\uff0c\u5dee\u522b\u5728\u4e8e\u4fee\u8865\u4f5c\u4e1a\u4f7f\u7528\u7684\u8def\u5f84\u4e0e\u6587\u4ef6\u540d\u82e5\u4e3asrc\/linux\/fs\/super.c\uff0c\u52a0\u4e0a”backup\/”\u5b57\u7b26\u4e32\u540e\uff0c\u6587\u4ef6super.c\u4f1a\u5907\u4efd\u4e8e\/src\/linux\/fs\/backup\u76ee\u5f55\u91cc <\/td><\/tr> -Z <\/td> \u628a\u4fee\u8865\u8fc7\u7684\u6587\u4ef6\u66f4\u6539\uff0c\u5b58\u53d6\u65f6\u95f4\u8bbe\u4e3aUTC <\/td><\/tr> --backup-if-mismatch <\/td> \u5728\u4fee\u8865\u6570\u636e\u4e0d\u5b8c\u5168\u543b\u5408\uff0c\u4e14\u6ca1\u6709\u523b\u610f\u6307\u5b9a\u8981\u5907\u4efd\u6587\u4ef6\u65f6\uff0c\u624d\u5907\u4efd\u6587\u4ef6 <\/td><\/tr> --binary <\/td> \u4ee5\u4e8c\u8fdb\u5236\u6a21\u5f0f\u8bfb\u5199\u6570\u636e\uff0c\u800c\u4e0d\u901a\u8fc7\u6807\u51c6\u8f93\u51fa\u8bbe\u5907 <\/td><\/tr> --help <\/td> \u67e5\u770b\u5e2e\u52a9\u4fe1\u606f <\/td><\/tr> --nobackup-if-mismatch <\/td> \u5728\u4fee\u8865\u6570\u636e\u4e0d\u5b8c\u5168\u543b\u5408\uff0c\u4e14\u6ca1\u6709\u523b\u610f\u6307\u5b9a\u8981\u5907\u4efd\u6587\u4ef6\u65f6\uff0c\u4e0d\u8981\u5907\u4efd\u6587\u4ef6 <\/td><\/tr> --verbose <\/td> \u8be6\u7ec6\u663e\u793a\u6307\u4ee4\u7684\u6267\u884c\u8fc7\u7a0b <\/td><\/tr><\/tbody><\/table>\n\n\n\n [root@linuxcool ~]# patch -p0 file1 file.patch <\/pre>\n\n\n\n
[root@linuxcool ~]# patch -p0 < foo.patch <\/pre>\n","protected":false},"excerpt":{"rendered":"