简体   繁体   English

递归查找具有相同名称的文件

[英]Recursively find files with same name

Help me please to find duplicate files in different folders 请帮助我在不同的文件夹中查找重复的文件

I have 2 wordpress uploads directories: 我有2个wordpress上传目录:

with the same structure: 具有相同的结构:

/uploads/2015/10/..
/uploads/2014/12/..
/uploads/somedir
..

Now I want to find all files with same path in 2 folders. 现在,我想在2个文件夹中找到所有具有相同路径的文件。 For example I can use rsync with -b flag, but i don't want to sync files right now. 例如,我可以将rsync与-b标志一起使用,但是我现在不想同步文件。

Any relevant help will be appreciated. 任何相关的帮助将不胜感激。

Try: 尝试:

diff -qr dir1/ dir2/

-q, --brief     report only when files differ
-r, --recursive     recursively compare any subdirectories found
    --no-dereference            don't follow symbolic links

Should do what you need. 应该做你所需要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM