grep的用法首先创建我们练习grep命令时需要用到的demo文件demo_file. $ cat demo_file THIS LINE IS THE 1ST UPPER CASE LINE IN THIS FILE. this line is the 1st lower case line in this file. This Line Has All Its First Character Of The Word With Upper Case. Two lines above this…
grep(global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来. 使用grep搜索某个关键字时,默认搜索出来的是所有包含该关键字的行,如下:搜索/var/named/veredholdings.cn_zone文件中172.16.50.24所在的行,默认会把所有包括172.16.50.24所在的行打印出来.[root@uat…