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)

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux