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 抓取以#为开头的内容

grep sbin /etc/passwd 抓取passwd下带sbin的 grep -v sbin /etc/passwd 反抓,不带sbin的 grep hello test 抓取test中的hello grep -i hello test 忽略大小写,抓取hello grep ^# test 抓取以#为开头的内容