grep 1.介绍 1.1 grep格式 1.2 grep字符数量匹配规则 1.3 练习:显示系统中能被su命令切换的用户名称 1.介绍 grep(global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。 grep -E = egrep 1.1 grep格式 grep 匹配条件 处理文件 grep "root" passwd ##过滤root关键字 grep "^root" passwd ##以root开头 grep "root$" passwd