find a file
brian.mckee at gmail.com
Sun Aug 12 16:01:08 UTC 2007
On Mon, 2007-06-08 at 08:12 -0400, John Dangler wrote:
> As to the secondary question regarding grep, to find a specific word
> in a file (or files) in a directory, I usually do this little shell
> script, typed at the commandline-
> for word in `ls`
> cat $word | grep "searchword"
> That will search each file in a directory and tell you which files
> have the word you want (if any)
> I wouldn't recommend this for extremely large directories (or an
> entire disk).
Grep has a recursive option - save your typing :-)
grep $word -r $directory
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 191 bytes
Desc: This is a digitally signed message part
More information about the ubuntu-users