Little GREPpings

Sometimes it is great to have the little help of grep. I’m often asked for some hints, so here are my favorite tiny commands:

grep -lir 'PATTERN' *

where the l stands for “give me only the file names”, i for “case insensitive”, r for recursive and the asterisk for all files (use *.xml or other wildcards to only search in certain files).

grep -lir 'PATTERN' * | grep -v "svn"

to search all files, except the svn files (hopefully there is no other filename with svn in it 😉 ). The | is the pipe operator.

I hope that they are useful and help you to grep around!

Leave a Reply

Your email address will not be published. Required fields are marked *