Answers:
diff
已经这样做了:
diff dir1 dir2
输出示例:
Only in dir1: some_file.txt
Only in dir1: some_other_file.txt
Only in dir2: third_file.txt
重击:
diff <(cd dir1; ls) <(cd dir2; ls)
仅比较文件名-不比较文件内容。
ls
,find
改用!
如果您也想在所有子目录中执行此操作,则一个好的方法是:
diff --brief -r dir1/ dir2/
我更喜欢使用简短的方法,但是如果需要,可以将其省略。
diff dir1 dir2 | grep "Only"