为什么 diff 没有按预期工作?

Why diff is not working as expected?

我有两个文件有很多路径,我想比较它们。但我不知道为什么它不适用于某些行: 同一行在 snapshot1 和 snapshot2 中,diff 继续显示它们,为什么?

root@minino:/tmp/diffshot# cat snapshot1|grep "MARCOS/lapiz.png"
-rw-r--r-- 1 minino minino 35247 may 19  2013 /home/minino/Imágenes/FONDOS/MARCOS/lapiz.png

root@minino:/tmp/diffshot# cat snapshot2|grep "MARCOS/lapiz.png"
-rw-r--r-- 1 minino minino 35247 may 19  2013 /home/minino/Imágenes/FONDOS/MARCOS/lapiz.png

root@minino:/tmp/diffshot# diff snapshot1 snapshot2 |grep "MARCOS/lapiz.png"
< -rw-r--r-- 1 minino minino 35247 may 19  2013 /home/minino/Imágenes/FONDOS/MARCOS/lapiz.png
> -rw-r--r-- 1 minino minino 35247 may 19  2013 /home/minino/Imágenes/FONDOS/MARCOS/lapiz.png

先尝试排序

cat snapshot1 | sort | uniq > snapshot1sorted

cat snapshot2 | sort | uniq > snapshot2sorted

diff -w snapshot1sorted snapshot2sorted |grep "MARCOS/lapiz.png