比较2个文件的不同处

for item in `cat 2.txt`
do
    grep $item 1.txt >/tmp/test.txt
    if [ $? -ne 0 ];then
       echo "$item"
    fi
done
原文地址:https://www.cnblogs.com/uglyliu/p/10796937.html