/** 鼠标样式 **/

grep详解

1.grep

grep (global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。用于过滤/搜索的特定字符。可使用正则表达式能配合多种命令使用,使用上十分灵活

2.命令详解

1.grep hello 1.txt
区分大小写
image

2.grep -i hello 1.txt
不区分大小写
image

3.grep -w hello 1.txt
精确打印
image

4.grep -e hello -e today 1.txt
打印多个匹配项
image

5.grep -n hello 1.txt
显示行数
image

6.grep -r hello /home/
在指定目录下查找文件内容
image

7.grep -E 'hello|today' 1.txt
启用正则表达式
image

posted @ 2024-04-12 13:10  aliex23k65  阅读(12)  评论(0)    收藏  举报