0

What's the difference between egrep and grep ?

I've been search for a while online and can't find anything concise.

Are they the same except that egrep has some extended regexp features? Thanks

Freddy
  • 25,565
Gpc
  • 1

2 Answers2

0

On my RHEL 8 system:

$ ls -la /usr/bin/egrep
-rwxr-xr-x. 1 root root 28 Aug 12  2018 /usr/bin/egrep
$ file /usr/bin/egrep
/usr/bin/egrep: POSIX shell script, ASCII text executable
$ cat /usr/bin/egrep
#!/bin/sh  
exec grep -E "$@"

So, yes - egrep is simply a wrapper around grep that turns on the extended regexp features.

John
  • 17,011
0

Extract from man page on Debian Gnu/Linux

       ... the variant programs egrep, fgrep and rgrep are the same
       as grep -E, grep -F, and grep -r,  respectively.   These  variants  are
       deprecated, but are provided for backward compatibility.