📜  linux grep 正则表达式返回匹配 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:16.707000             🧑  作者: Mango

代码示例1
-o, --only-matching Show only the part of a matching line that matches PATTERN.

$ egrep -o 'key \w+' file 
key word1
key word2