{"id":1049,"date":"2019-04-30T00:18:10","date_gmt":"2019-04-29T16:18:10","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=1049"},"modified":"2019-05-01T18:31:54","modified_gmt":"2019-05-01T10:31:54","slug":"comm","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/comm","title":{"rendered":"comm\u547d\u4ee4 – \u6bd4\u8f83\u4e24\u4e2a\u5df2\u6392\u8fc7\u5e8f\u7684\u6587\u4ef6"},"content":{"rendered":"\n

comm\u547d\u4ee4\u4f1a\u4e00\u5217\u5217\u5730\u6bd4\u8f83\u4e24\u4e2a\u5df2\u6392\u5e8f\u6587\u4ef6\u7684\u5dee\u5f02\uff0c\u5e76\u5c06\u5176\u7ed3\u679c\u663e\u793a\u51fa\u6765\uff0c\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u4efb\u4f55\u53c2\u6570\uff0c\u5219\u4f1a\u628a\u7ed3\u679c\u5206\u62103\u884c\u663e\u793a\uff1a\u7b2c1\u884c\u4ec5\u662f\u5728\u7b2c1\u4e2a\u6587\u4ef6\u4e2d\u51fa\u73b0\u8fc7\u7684\u5217\uff0c\u7b2c2\u884c\u662f\u4ec5\u5728\u7b2c2\u4e2a\u6587\u4ef6\u4e2d\u51fa\u73b0\u8fc7\u7684\u5217\uff0c\u7b2c3\u884c\u5219\u662f\u5728\u7b2c1\u4e0e\u7b2c2\u4e2a\u6587\u4ef6\u91cc\u90fd\u51fa\u73b0\u8fc7\u7684\u5217\u3002\u82e5\u7ed9\u4e88\u7684\u6587\u4ef6\u540d\u79f0\u4e3a\u201d-\u201c\uff0c\u5219comm\u6307\u4ee4\u4f1a\u4ece\u6807\u51c6\u8f93\u5165\u8bbe\u5907\u8bfb\u53d6\u6570\u636e\u3002 <\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>[\u53c2\u6570] [\u6587\u4ef61][\u6587\u4ef62]<\/p>\n\n\n\n
-1  <\/td>\u4e0d\u663e\u793a\u53ea\u5728\u7b2c1\u4e2a\u6587\u4ef6\u91cc\u51fa\u73b0\u8fc7\u7684\u5217<\/td><\/tr>
-2<\/td>\u4e0d\u663e\u793a\u53ea\u5728\u7b2c2\u4e2a\u6587\u4ef6\u91cc\u51fa\u73b0\u8fc7\u7684\u5217 <\/td><\/tr>
-3<\/td>\u4e0d\u663e\u793a\u53ea\u5728\u7b2c1\u548c\u7b2c2\u4e2a\u6587\u4ef6\u91cc\u51fa\u73b0\u8fc7\u7684\u5217 <\/td><\/tr>
\u2013help <\/td>\u5728\u7ebf\u5e2e\u52a9 <\/td><\/tr>
\u2013version <\/td>\u663e\u793a\u7248\u672c\u4fe1\u606f <\/td><\/tr><\/tbody><\/table>\n\n\n\n

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

\u5bf9\u6bd4\u6587\u4ef6filename1.txt\u548cfilename2.txt\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# comm filename1.txt filename2.txt <\/pre>\n\n\n\n

\u6253\u5370\u4e24\u4e2a\u6587\u4ef6\u7684\u4ea4\u96c6\uff0c\u9700\u8981\u5220\u9664\u7b2c\u4e00\u5217\u548c\u7b2c\u4e8c\u5217\uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# comm filename1.txt filename2.txt -1 -2<\/pre>\n\n\n\n

\u6253\u5370\u51fa\u4e24\u4e2a\u6587\u4ef6\u4e2d\u4e0d\u76f8\u540c\u7684\u884c\uff0c\u9700\u8981\u5220\u9664\u7b2c\u4e09\u5217\uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# comm filename1.txt filename2.txt -3 | sed 's\/^\\t\/\/'<\/pre>\n\n\n\n

\u76f8\u8f83\u4e8efilename2.txt\uff0cfilename1.txt\u7684\u5dee\u96c6 :<\/p>\n\n\n\n

[root@linuxcool ~]# comm filename1.txt filename2.txt -2 -3<\/pre>\n\n\n\n

\u76f8\u8f83\u4e8efilename1.txt\uff0cfilename2.txt\u7684\u5dee\u96c6 :<\/p>\n\n\n\n

[root@linuxcool ~]# comm filename2.txt filename1.txt -2 -3<\/pre>\n\n\n\n

<\/p>\n","protected":false},"excerpt":{"rendered":"

comm\u547d\u4ee4\u4f1a\u4e00\u5217\u5217\u5730\u6bd4\u8f83\u4e24\u4e2a\u5df2\u6392\u5e8f\u6587\u4ef6\u7684\u5dee\u5f02\uff0c\u5e76\u5c06\u5176\u7ed3\u679c\u663e\u793a\u51fa\u6765\uff0c\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u4efb\u4f55\u53c2\u6570\uff0c\u5219\u4f1a\u628a\u7ed3\u679c\u5206\u62103\u884c\u663e […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1049"}],"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=1049"}],"version-history":[{"count":9,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1049\/revisions"}],"predecessor-version":[{"id":1845,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1049\/revisions\/1845"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=1049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=1049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=1049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}