说明,是通过file2内容与file1做比较,最后列出file1与file2不同的部分! 一.准备两个文件: [root@kinggoo.com test1]# cat file1 a b c d e [root@kinggoo.com test1]# cat file2 c e 二.比较方法: 方法一:grep 命令 [root@kinggoo.com test1]# grep -v -f file2 file1 a b d 方法二:comm 命令 [root@kinggoo.com test