All,
I want to find ONLY the directories containing ...say "*.log" under some $MY_HOME.
man on find does not seem to yield any suitable option for me.
need to do this on a Sun system.
help (verily) appriciated. ( )
Regards
All,
I want to find ONLY the directories containing ...say "*.log" under some $MY_HOME.
man on find does not seem to yield any suitable option for me.
need to do this on a Sun system.
help (verily) appriciated. ( )
Regards
How about this.
find $MY_HOME -name '*.log' -exec dirname {} \;
That will give you the same directory more than once if there are more than 1 log file in the respective directory. You could sort and do an uniq on that list.
Vino
I think that it would be better to use 'sort -u' instead of using two different commands.
wish to thank both of you for the neat solution to my problem.
find $MYHOME -type d -name \*.log
??