根据内容过滤文本信息
grep
[root@rstx-201 ~]# grep root /etc/passwd
root:x:0:0:root:/root:/bin/bash
operator:x:11:0:operator:/root:/sbin/nologin
加上通配符^ 以root开头
grep ^root /etc/passwd
root:x:0:0:root:/root:/bin/bash
加上通配符$ 以bash结尾
grep bash$ /etc/passwd
root:x:0:0:root:/root:/bin/bash
postgres:x:26:26:PostgreSQL Server:/var/lib/pgsql:/bin/bash
yangtao:x:1001:1001::/home/yangtao:/bin/bash