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

Re: Finding files containing 'string'

On Wed, 1 Feb 2006 16:42:19 +0000
Anne Wilson <cannewilson tiscali co uk> 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/)


   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.


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)

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