grep(Globel Search Regular Expression and Printing out the line)全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,是一个对行进行操作的搜索工作,它能使用正则表达式搜索文本,并把匹配的行打印出来。Unix的grep家…
一、基础的grep命令
1.1 -A -B -C参数的使用
命令格式:grep -A m “关键字” xxxx(文件) 显示出关键字所在行以及关键字所在的以下m行内容 [rootlocalhost ~]# grep -A 10 “game” /etc/passwd #搜索出关键字“game” 并打印出关键字所在的…