Yes i understood your problem ..
ill tell you the simple command to solve your problem
1> To delete only the specified files in a perticular directory and subdirectory use the below command
find <dir_path> -name <search_format> -delete
ex:
find /home/avi/examples/ -name "*.html" -delete
----
to just print all required files
find /home/avi/example/ -name "*.html" -print
----------------------------------------------------------------------------------------------------
2>To change the mode for each file type which you want
for eachFile in `find /home/avi/examples/ -name "*.sh" -print`
do
chmod 700 $eachFile
done
### ateya i thing all your problems solved...
----------------------------------------------------------------------------------------------------
Regards:Avinash... A Real Angry Man