grep -r "text" . --include="*.cpp"
grep -r "text" . --include=*.{cpp,h} or use multiple --include
grep -r -v "contentpane" . | grep "ntp" // exclude line with "contentpane" and search the result for "ntp"
grep -r -v "contentpane" . | grep "ntp" // exclude line with "contentpane" and search the result for "ntp"
-A NUM After
-B NUM Before
-C NUM or just -NUM Context
e.g.
grep -5 -r "text" . 5 lines before and after the matched text
No comments:
Post a Comment