Re: files

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

 



On 27Nov2006 16:39, Kevin Kempter <kevin@xxxxxxxxxxxxxxxxxxx> wrote:
| 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

"grep -rl" will do the same thing, and _much_ faster because it does not
need to fork/exec a new "group" command for every file. The performance
difference is quite significant.
-- 
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/

But you've got to admit that in special effects, JP was to previous
rubber-monster romps as "Star Wars" was to "Lost in Space." I
especially liked the frilly little one that cooed softly until its
victim got close, then spit venom in his face.  Brought back memories
of... ah, never mind; you wouldn't know her anyway.
        - jtchew@xxxxxxxxxx (Joe Chew)


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

  Powered by Linux