Re: Finding files containing 'string'

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

 



On Wednesday 01 Feb 2006 23:00, Daniel Vogel wrote:
> > > I had two suggestions:
> > > 1. gnome-search-tool
> > > 2. find ./ -name "*" -exec grep "string" {} /dev/null \;
> > >
> > > Someone suggested even a better command solution than 2. above
> > > but I can't remember what it is.
> > > --
> >
> >find . -type f -print0 |xargs -0 grep "string"
> >
> >should work.
>
> ..err...my sugestion is much simple...
>
> grep -e <string> <files>
>
> the for example:
> grep -e Daniel *.html
>
> will show me in wich file the line WITH the string "Daniel" will
> appear. being more efficient, you can place another flag to show you
> the exact line number.
>
> No need of cat, nor more to search on every file on a
> directory...haven't tryed yet on a full root search.
>
> Hiope it helps.

The problem is that, while this looks simple, I'm trying to find all 
config files that refer to my lan-name, and config files don't have a 
specific extension.  In fact I can't think of any regular pattern to 
their names.

The problem with searches like Aaron's and Les' is that they pick up all 
the hundreds of email messages from both my current installation and 
the previous one, since I routinely mount an OldHome partition (one 
such search is still running).  I could umount OldHome, but there's 
still going to be a lot of mail messages.  Then there are hundreds more 
in the kde tmp files.  Maybe I'm asking the impossible.  I'll just have 
to back up and hope I find all the ones I need without too much delay.  

Thanks to all for the suggestions.

Anne
-- 
Registered Linux User No.293302 (http://counter.li.org/)

Attachment: pgpuToFspBnlk.pgp
Description: PGP signature


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

  Powered by Linux