Linux 如何比较bash中两个directories的内容?

Linux 如何比较bash中两个directories的内容?,linux,bash,directory,comparison,zsh,Linux,Bash,Directory,Comparison,Zsh,假设有两个dir /path1 and /path2 比如说 /path1/bin /path1/lib /path1/... /path2/bin /path2/lib /path2/... 人们需要知道它们在内容(文件名称和文件内容)上是否相同,如果没有列出差异 在Linux中如何做到这一点? 有一些Bash/Zsh命令吗?我正在使用这个脚本执行这样的任务: diff <(cd "$dir1"; find . -type f -printf "%p %s\n" | sort) \

假设有两个dir

/path1 and /path2
比如说

/path1/bin
/path1/lib
/path1/...

/path2/bin
/path2/lib
/path2/...
人们需要知道它们在内容(文件名称和文件内容)上是否相同,如果没有列出差异

在Linux中如何做到这一点?
有一些Bash/Zsh命令吗?

我正在使用这个脚本执行这样的任务:

diff <(cd "$dir1"; find . -type f -printf "%p %s\n" | sort) \
     <(cd "$dir2"; find . -type f -printf "%p %s\n" | sort)       

diffdiff命令可以显示两个目录之间的所有差异:

diff-qr/path1/path2
有人已经提出了这个建议,但删除了他们的答案,不知道为什么。尝试使用
rsync

rsync -avni /path1/ /path2
此程序通常会同步两个文件夹,但如果使用-n,它将进行一次试运行。

什么是“a”和“b”?您还需要
-r