grep
man - print lines matching a pattern
打印出符合样本字符的行
在文件中查找字符串
[root@localhost ~]# grep yin text
yin:1
[root@localhost ~]# grep 0 text xd.pem // 多文件查找
text:Yin:0
text:13dian:0
text:38nv:0
xd.pem:MIIEpAIBAAKCAQEAw3qB614P7QWMVRqXtylXQzp2TJpp3p/cRU0WJ1J43cJqH7CZ/hYBvtqwVTnm
xd.pem:MqUkE4SzuhdO9STn28okarGruA5TGaGxjv5gs06WPGBHEKxB1W2zYL+wgEYkipknarD+gBjJi83A
[root@localhost ~]# grep -v 0 text // 反向查找
yin:1
jian:14
wen:2
Wen:484
匹配的行数和行号
[root@localhost ~]# grep -c 0 text
3
[root@localhost ~]# grep -n 0 text
1:Yin:0
6:13dian:0
7:38nv:0
循环匹配
grep yin ./ -r