Recursive grep

Posted by admin on Dec 24, 2009 in Mac OS X, Unix |

I don’t do this often enough to remember, so I figured I’d write it down. ¬†For example, to look for all the places where you include stdio.h in .cpp files below the current directory:

$ grep -r -n --include "*.cpp" '#include <stdio.h>' .

Comments are closed.

Copyright © 2017 Standalone Code LLC All rights reserved. Theme by Laptop Geek.