- 匹配整个单词,
grep -w world
- 匹配多个单词,
grep -E '(hello|world)'
,或grep -e '\(hello\|world\)'
Linux命令行 - grep
- 本文链接: http://sunyongfeng.com/201805/shell/grep.html
- 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
Keep it simple, stupid
grep -w world
grep -E '(hello|world)'
,或 grep -e '\(hello\|world\)'