grep 基本用法

grep

usage: grep [options]... pattern [file]...
如果file缺省,会从 stdin 读取

$ grep --help
-i 忽略大小写
-n 显示行号
-A <num> 显示匹配行以及之后 num 行
-B <num> 显示匹配行以及之前 num 行
-C <num> 显示匹配行以及前后 num 行

例子

用到再说

猜你喜欢

转载自www.cnblogs.com/kirito1/p/12112686.html