Finding files that contain certain text
December 11th, 2005
I keep forgetting how to do this and then having to look it up. So here, for quicker access next time I forget, is how it's done:
To find files in or below the current directory that contain the text string "if I only had a brain" enter the command:
find . -type f -print | xargs grep 'if I only had a brain' | more
Thanks to:
www.geocities.com/samarstan/linux/penguin/linuxuser.html
for reminding me how it was done on this occasion.
Potentially similar posts
- Convert escaped Unicode to HTML entities – January 2012
- Adding your choice of text editor to Flare’s Open With menu – December 2010
- Fix “No topics found” issue in CHM output – November 2010
- Perl basics for beginners (on Windows) – August 2010
- Gotchas with running a Perl script as a cron job – August 2010