rhcsa——grep正则表达式

 

 

grep sbin /etc/passwd 抓取passwd下带sbin的
grep -v sbin /etc/passwd 反抓,不带sbin的
grep hello test 抓取test中的hello
grep -i hello test 忽略大小写,抓取hello
grep ^# test 抓取以#为开头的内容
posted @ 2020-05-09 21:12  eafrh  阅读(119)  评论(0)    收藏  举报