Re: files

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

 



On Monday 27 November 2006 15:54, Steve Searle wrote:
> Around 10:34pm on Monday, November 27, 2006 (UK time), eng.waleed scrawled:
> > How can I find the files which  containing a particular string in 
> > directory and all subdirectory
>
> grep -r string directory/*
>
> Steve

find <dir> -exec grep -l "string" \;

i.e.

find . -exec -l "My String" \;
-- will find all files with the string 'My String' (doesn't match the quotes) 
starting at the current dir (.) and below

The -l for grep says only print the filename


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

  Powered by Linux