介绍 本文介绍grep使用技巧。 ifconfig | grep eth -A 3 打印过滤到的那一行以及之后的3行 ifconfig | grep eth -B 3 打印过滤到的那一行以及之前的3行 ifconfig | grep eth -v 打印不包含eth的行 ifconfig | grep ETH -i 过滤时不区分大小写 grep number * -n -r 遍历查找当前文件夹以及子文件夹中所有文件包含number文件,并打印匹配行号 转载于:https://my.oschina.net/surenpi/blog/481847