Can any one tell me the technical difference between grep and egrep, and fgrep and provide a suitable example?
When do I need to use grep over egrep and vice versa?
|
Can any one tell me the technical difference between When do I need to use |
||||
|
Historically these switches were provided in separate binaries. On some really old Unix systems you will find that you need to call the separate binaries, but on all modern systems the switches are preferred. The man page for grep has details about this. As for what they do,
The
Here are some example scenarios:
|
|||||
|
|
From "man grep":
|
|||
|
|
|
Error messages might differ though. |
|||
|
|
|
From
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.
You use You use |
|||||
|