faqts : Computers : Operating Systems : Linux : Shell Commands

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 2 people (50%) answered Yes
Recently 1 of 2 people (50%) answered Yes

Entry

How to find only the directories name containing specific files for example directory names of directories containing header files or .c files etc

Oct 11th, 2004 06:44
Ankit Sharma,


Following script will do the work:
#################################################################
find . -name *.h | awk -F/ '{for (i=1;i<NF;i++) printf "%s/",$i; 
printf"\n"}'|uniq
#################################################################
Suggestions are always welcome to improve this script.