Trucos con grep

Searching through lots of text files has become a daily task. Grep is great for this, and this are some nice tips:

Search for the string “patata” in the whole directory
grep -R patata *

Search for the string “patata” in the whole directory and group by file name:
grep -R -l patata *

Search for the string “patata” in the whole directory and group by file name and exclude the .svn files:
grep -R -l patata * | grep -v ‘.svn’

Hope you enjoy it!

Post a comment.