1.grep 是查找含有指定文本行的意思,比如grep 'test' 就是查找含有test的文本的行
2.grep -v 是反向查找的意思,比如 grep -v "grep" 就是查找不含有 grep 字段的行; grep -v ^# /etc/profile就是不显示以#开头的行
例如 ps -ef | grep '/home/helife/tomcat-wap/' | grep -v "grep"
查看包含 '/home/helife/tomcat-wap/' 但不包含 "grep" 的进程
过滤空白行
grep -v '^$' abc.txt
不显示以#开头的行
grep -v '^#' abc.txt
找有aaa 但是没有 bbb, ccc的行
grep aaa . -rs | grep -v bbb | grep -v ccc | grep -v grep