Thursday, April 3, 2008

Linux Commad ctags with find

catgs:
ctags -w `find $(SUBDIRS) include common \( -name CVS -prune \) -o \( -name '*.[ch]' -print \)`

find [options]
-name '*.[ch]' => This option restricts *.c and *.h files only
-prune -o -print => use to display and cut out subdirectories

This will search only .c and .h files with argument as search pattern"
alias f "find . -name '*.[c,h]' -print | xargs grep -n --color $1 "
eg: f pattern