[KLUG Members] Re: Re: grep, egrep, fgrep

John Pesce members@kalamazoolinux.org
06 May 2004 12:12:58 -0400


Thanks all,

I think I got grep on the difference between the greps now ;)
Sorry, pun intended

Ok on recap I've learned the period needs to be escaped using either one
\ with quotes or two \ without quotes.

ls | grep '\.s'   or   ls | grep \\.s



My other question was about grepping for multiple items, like cat or dog

Adam suggested grep -F "cat\ndog"

Does the \n mean anything? Will it match if they are on the same line?

More searching turned up something like:

egrep 'cat|dog' file

which seems to work. Is this the same command internally?