Finding files containing…

Posted: 10 December 2010 in Uncategorized

If like me recently you have to find files containing a certain string, you can do this from the command line very easily…

hayStack="/tmp"; # set this to where you want to look for files
seeking="needle"; # set this to what you need to find
find $hayStack -name "*" -type f -exec grep -l "$seeking" {} \;
Advertisements
Comments
  1. Tanguy Rademakers says:

    http://www.betterthangrep.com/

    try this. It’s a single file perl script and it works quite well with iwperl.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s