grep, egrep, fgrep - print lines matching a pattern
用法:
| options | description | 解释 |
|---|---|---|
| -n | Prefix each line of output with the 1-based line number within its input file. | 打印行号 |
| -v | nvert the sense of matching, to select non-matching lines. | 不包含该字符串 |
| -i | Ignore case distinctions in both the PATTERN and the input files | 忽略大小写 |
| -E | 相当于egrep命令 | |
| -o | Print only the matched parts of a matching line | 只打印匹配部分 |
实例 :

