On 06/08/2010 12:40 PM, Kaushal Shriyan wrote:
Hi,
can someone explain me about the usage of grep , fgrep and egrep
with examples.
In what contexts i should use which.
The grep man page explains it well enough:
In addition, two variant programs egrep and fgrep are
available. egrep is the same as grep -E. fgrep is the same as grep -F. Direct
invocation as either egrep or fgrep is deprecated, but is provided to
allow historical applications that rely on them to run
unmodified.
-E, --extended-regexp
Interpret PATTERN as an extended regular expression (ERE, see below). (-E
is specified by POSIX.)
-F, --fixed-strings
Interpret PATTERN as a list of fixed strings, separated by newlines,
any of which is to be matched. (-F is specified by
POSIX.)
When in doubt, RTFM.
Please guide/suggest
Thanks and Regards,
Kaushal
--
Kevin J. Cummings
kjchome(a)rcn.com
cummings(a)kjchome.homeip.net
cummings(a)kjc386.framingham.ma.us
Registered Linux User #1232 (
http://counter.li.org)