{"id":2304,"date":"2019-05-28T00:02:47","date_gmt":"2019-05-27T16:02:47","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=2304"},"modified":"2022-05-29T00:23:38","modified_gmt":"2022-05-28T16:23:38","slug":"diff","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/diff","title":{"rendered":"diff\u547d\u4ee4 – \u6bd4\u8f83\u6587\u4ef6\u5185\u5bb9\u5dee\u5f02"},"content":{"rendered":"\n

diff\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u5355\u8bcddifferent\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u6bd4\u8f83\u6587\u4ef6\u5185\u5bb9\u5dee\u5f02\u3002\u5982\u679c\u6709\u591a\u4e2a\u5185\u5bb9\u76f8\u8fd1\u7684\u6587\u4ef6\uff0c\u5982\u4f55\u5feb\u901f\u5b9a\u4f4d\u5230\u4e0d\u540c\u5185\u5bb9\u6240\u5728\u4f4d\u7f6e\uff1f\u6b64\u65f6\u7528diff\u547d\u4ee4\u5c31\u518d\u5408\u9002\u4e0d\u8fc7\u4e86~\uff01<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>diff [\u53c2\u6570] \u6587\u4ef61 \u6587\u4ef62<\/p>\n\n\n\n

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

-a <\/td>\u9010\u884c\u6bd4\u8f83\u6587\u672c\u6587\u4ef6 <\/td><\/tr>
-b <\/td>\u4e0d\u68c0\u67e5\u7a7a\u683c\u5b57\u7b26\u7684\u4e0d\u540c <\/td><\/tr>
-W<\/td>\u6307\u5b9a\u680f\u5bbd <\/td><\/tr>
-x<\/td>\u4e0d\u6bd4\u8f83\u9009\u9879\u4e2d\u6240\u6307\u5b9a\u7684\u6587\u4ef6\u6216\u76ee\u5f55 <\/td><\/tr>
-X<\/td>\u5c06\u6587\u4ef6\u6216\u76ee\u5f55\u7c7b\u578b\u5b58\u6210\u6587\u672c\u6587\u4ef6<\/td><\/tr>
-y <\/td>\u4ee5\u5e76\u5217\u7684\u65b9\u5f0f\u663e\u793a\u6587\u4ef6\u7684\u5f02\u540c\u4e4b\u5904 <\/td><\/tr>
--brief<\/td>\u4ec5\u5224\u65ad\u4e24\u4e2a\u6587\u4ef6\u662f\u5426\u4e0d\u540c<\/td><\/tr>
--help <\/td>\u67e5\u770b\u5e2e\u52a9\u4fe1\u606f <\/td><\/tr>
--left-column <\/td>\u82e5\u4e24\u4e2a\u6587\u4ef6\u67d0\u4e00\u884c\u5185\u5bb9\u76f8\u540c\uff0c\u5219\u4ec5\u5728\u5de6\u4fa7\u7684\u680f\u4f4d\u663e\u793a\u8be5\u884c\u5185\u5bb9 <\/td><\/tr>
--suppress-common-lines <\/td>\u5728\u4f7f\u7528-y\u53c2\u6570\u65f6\uff0c\u4ec5\u663e\u793a\u4e0d\u540c\u4e4b\u5904 <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

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

\u4ec5\u5224\u65ad\u4e24\u4e2a\u6587\u4ef6\u662f\u5426\u4e0d\u540c\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# diff --brief diff_A.txt diff_B.txt<\/strong>\nFiles diff_A.txt and diff_B.txt differ<\/pre>\n\n\n\n

\u6bd4\u8f83\u4e24\u4e2a\u6587\u4ef6\u5185\u5bb9\u7684\u4e0d\u540c\u4e4b\u5904\uff0c\u5b9a\u4f4d\u6240\u5728\u884c\u6570\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# diff -c diff_A.txt diff_B.txt<\/strong>\n*** diff_A.txt 2020-08-30 18:07:45.230864626 +0800\n--- diff_B.txt 2020-08-30 18:08:52.203860389 +0800\n***************\n*** 1,5 ****\n! Welcome to linuxprobe.com\nRed Hat certified\n! Free Linux Lessons\nProfessional guidance\nLinux Course\n--- 1,7 ----\n! Welcome tooo linuxprobe.com\n!\nRed Hat certified\n! Free Linux LeSSonS\n! \/\/\/\/\/\/\/\/.....\/\/\/\/\/\/\/\/\nProfessional guidance\nLinux Course<\/pre>\n","protected":false},"excerpt":{"rendered":"

diff\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u5355\u8bcddifferent\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u6bd4\u8f83\u6587\u4ef6\u5185\u5bb9\u5dee\u5f02\u3002\u5982\u679c\u6709\u591a\u4e2a\u5185\u5bb9\u76f8\u8fd1\u7684\u6587\u4ef6\uff0c\u5982 […]<\/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\/2304"}],"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=2304"}],"version-history":[{"count":15,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/2304\/revisions"}],"predecessor-version":[{"id":10180,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/2304\/revisions\/10180"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=2304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=2304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=2304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}