QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 958|回复: 2

找出某个目录及子目录下同名的文件,前是我不知道重名的文件名。

[复制链接]
发表于 2005-6-6 12:20:09 | 显示全部楼层 |阅读模式
找出某个目录及子目录下同名的文件,前是我不知道重名的文件名。
发表于 2005-6-6 13:00:45 | 显示全部楼层
try:[code:1]
find /path -type f -exec basename {} \;|sort|uniq -D|while read file;do find $(pwd) -name $file;done|sort|uniq -d
[/code:1]
回复

使用道具 举报

发表于 2005-6-6 13:40:29 | 显示全部楼层
[quote:9408cc8663="kornlee"]find /path -type f -exec basename {} \;|sort|uniq -D|while read file;do find $(pwd) -name $file;done|sort|uniq -d
[/quote]这样好像不行吧?

改一下:[code:1] find /path/ -type f -exec basename {} \; | sort | uniq -d | while read file; do echo -e "\n$file:" && find /path/ -type f -name $file; done[/code:1]
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-10-3 05:35 , Processed in 0.043890 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表