Re: Finding files containing 'string'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 1 Feb 2006 16:42:19 +0000
Anne Wilson <cannewilson@xxxxxxxxxxxxx> wrote:

> I need to list all files that refer to my network-name, but I can't work 
> out a command to do it.  I thought I would have to cat everything, 
> piping through grep 'string', but that doesn't search recursively, the 
> help-file doesn't show a recursive flag, and I'm not sure that it would 
> actually give me the filenames anyway.
> 
> Help, please?
> 
> Anne
> -- 
> Registered Linux User No.293302 (http://counter.li.org/)

 Anne,


   find $startpoint -type f -exec grep -l $network-name {} \;

  Change $startpoint to whatever place in the directory tree that you want to
begin the search or cd to that place and use "." as the startpoint. Change
$network-name to the string that you want to look for.


 Dave

-- 
Being shot out of a cannon will always be better than being squeezed
out of a tube.  That is why God made fast motorcycles, Bubba....
  "Song of the Sausage Creature" Hunter S. Thompson (RIP 02/20/2005)


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux