[NBLUG/talk] Finding files containing a string

Kyle Rankin kyle at nblug.org
Sun Dec 12 11:27:32 PST 2004


On Sun, Dec 12, 2004 at 08:59:27AM -0800, Todd Cary wrote:
> I want to find all files containing the string "interbase.so".  If I do
> 
> ls -Rl * | grep "interbase.so"
> 
> I do not get the directory.  What is the best way to do this?
> 
> Todd
> -- 

You want to use find instead of piping ls to grep:

  find ./ -name "*interbase.so*" -print

If you are specifically looking for directories, you can narrow down find
by telling it to only find directories:
  
  find ./ -type d -name "*interbase.so*" -print

-- 
Kyle Rankin
NBLUG President
The North Bay Linux Users Group
http://nblug.org
IRC: greenfly at irc.freenode.net #nblug 
kyle at nblug.org




More information about the talk mailing list