Find text within files
May 1st, 2008Stuck trying to find text within files on Linux?
cd /directory_tree_you_want_to_search
find . -type f -exec grep -l "string to find" {} \; -print
Easy!
| Bookmark it del.icio.us | Reddit | Slashdot | Digg | Facebook | Technorati | Google | StumbleUpon | Window Live | Tailrank | Furl | Propeller | Yahoo |
Was this post useful to you? Let me know, buy me a beer!
Alternatively, if you're feeling impecunious, you may like to subscribe to my RSS feed, or see other articles in the Geekery, Linux category.
May 4th, 2008 at 21:06
grep -lir ’some text’ *
May 4th, 2008 at 21:09
Almost as good, but I found it freaked out with symbolic links occasionally.