I have a question about grep
and egrep
in unix
.
As I am recently studying the shell commands
in unix
, I want to know what are the differences between grep and egrep.
I find we can use grep and egrep with regular expression. However, I found something different between these two commands:
For ^
, grep and egrep have the same meaning which is finding the lines contain the given stuffs at the very beginning.
However, for |
, grep, without back slash in front of |
, means character of |
, and if I put a back slash in front of it, it turns on it special meaning of finding the line contains either the stuff in front of it and behind it. BUT, for egrep, it is the opposite. |
has the latter meanings of grep and |
has the former meaning of grep when uses it.
Could somebody else kindly explain why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…