页面“每天一命令之du”与“每天一命令之grep”之间的差异
(页面间的差异)
跳到导航
跳到搜索
docker>Evan |
docker>Evan |
||
第1行: | 第1行: | ||
− | = | + | =常用参数= |
<pre> | <pre> | ||
− | + | #多个and | |
− | + | ps -ef | grep -E 'tomcat1 |tomcat2 |grep -v grep ' | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | - | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
− | + | [http://blog.51cto.com/haowen/2068456 find & grep 总结] | |
− | |||
− | |||
− | |||
− | |||
− | + | == 精准 非贪婪匹配== | |
− | + | <pre> -w, --word-regexp 强制 PATTERN 仅完全匹配字词 | |
− | + | Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a | |
− | + | non-word constituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are | |
− | + | letters, digits, and the underscore. This option has no effect if -x is also specified. | |
− | |||
− | |||
</pre> | </pre> | ||
− | + | [[category:shell]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
2018年12月27日 (四) 08:18的版本
常用参数
#多个and ps -ef | grep -E 'tomcat1 |tomcat2 |grep -v grep '
精准 非贪婪匹配
-w, --word-regexp 强制 PATTERN 仅完全匹配字词 Select only those lines containing matches that form whole words. The test is that the matching substring must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it must be either at the end of the line or followed by a non-word constituent character. Word-constituent characters are letters, digits, and the underscore. This option has no effect if -x is also specified.