Total Pageviews

Sunday, May 19, 2013

Find with line number and excluding directory

find . -path ./excl_dir -prune -o -name *.c | xargs grep -n "SearchString" 2>/dev/null

This will exclude the excl_dir directory from searching.
The grep will SearchString with line numbers in the files where it is found.