[root@study shell-study]# cat file
i love python
lovelove python
love
I Love PYTHON
I Love pYtHoN
[root@study shell-study]# grep python file
i love python
lovelove python
[root@study shell-study]#
[root@study shell-study]# grep -E 'python|PYTHON' file
i love python
lovelove python
I Love PYTHON
grep默认是不支持扩展正则表达式,只支持基础正则表达式
使用grep -E可以支持扩展正则表达式
使用egrep可以支持扩展正则表达式,与grep -E等价