Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 May 2009 14:56:22 +0300
From:      Valentin Bud <valentin.bud@gmail.com>
To:        Zbigniew Szalbot <z.szalbot@lcwords.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: find and searching for specific expression in files
Message-ID:  <139b44430905300456x62bf9c0ybf46bcab6b64e25@mail.gmail.com>
In-Reply-To: <80cddf609e38046ffa0ce3f2bdab235c.squirrel@relay.lc-words.com>
References:  <dd6b168d2af9ddbcfc52e5c0397e4d6a.squirrel@relay.lc-words.com>  <20090530101328.GA59991@owl.midgard.homeip.net> <80cddf609e38046ffa0ce3f2bdab235c.squirrel@relay.lc-words.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2009/5/30 Zbigniew Szalbot <z.szalbot@lcwords.com>

> >> Can you please give me a hint how to use find to search for a specific
> >> text within files?
> >
> > Generally, you don't - find(1) does not examine the contents of files by
> > itself, just their directory information.  You normally use grep(1) to
> > search within a file.
>
> Ahhh - I use grep on daily basis. Now why didn't I think of it? I got so
> fixed on the idea of using find that I completely forgot about grep....
>
> Sorry for the noise and thank you very much for your help!
>
> --
> Zbigniew Szalbot
>
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscribe@freebsd.org"
>
Hello Mr. Zbigniew Szalbot,

 You can use egrep -r * (grep -e) to search for specific text pattern while
you are in a directory with many sub directories. The output is nice because
it tells you the file in which the text pattern was found :).

a great day,
v


-- 
network warrior since 2005



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?139b44430905300456x62bf9c0ybf46bcab6b64e25>