拷贝以下代码,保存为.sh文件执行
#!/bin/bash
dir_arr=$(find -name "*h" -print;)
temp_path="temp_path.txt"
if [ -f $temp_path ]; then
rm -r $temp_path
fi
for dir in ${dir_arr[*]}
do
find $dir -type f >> $temp_path
done
for file in $(awk -F '/' '{print $NF}' $temp_path | sort | uniq -d)
do
echo $file
done