Sunday, 26 February 2017

How to grep in a certain kind of file?

Use the --include optoin, E.g. just grep in header file (*.h) and source file (*.cpp)
 
grep -rn --include \*.h --include \*.cpp 'word_to_grep'  dst/directory/

No comments:

Post a Comment