The grep command is a powerful text-search tool in Unix-like systems, the full name of the global Regular expression Print, which represents the globally regular expression version, which is used by all users.
The command format is:
grep file
Common option is:
-I.--ignore- Case#忽略字符大小写的差别. -N--line-Number #在显示符合样式的那一行之前 that indicates the column number of the row. -R--recursive #此参数的效果和指定 "-d recurse "parameter is the same. -S--no-messages #不显示错误信息. -A--text #不要忽略二进制的数据. -a< Display lines >#除了显示符合范本样式的那一列之外, and displays the contents after the line. -b< Display lines >#除了显示符合样式的那一行之外 and displays the contents before the line. -C--Count #计算符合样式的列数. -c< Display lines >#除了显示符合样式的那一行之外, and displays the contents of the line before it. -D < action >#当指定要查找的是目录而非文件时, this parameter must be used, otherwise the grep command returns information and stops the action. -H--no-filename #在显示符合样式的那一行之前, does not indicate the name of the file to which the line belongs. -H--with-filename #在显示符合样式的那一行之前 that represents the name of the file to which the row belongs.
Regular expression:
^ matches the starting line of the regular expression to match the end line of the regular expression \< starts with the line that matches the regular expression \>-] range;
Linux grep command