grep 精确匹配

Posted on Posted in command
文章目录[隐藏]

grep 精确匹配

grep 精确匹配单词, 可以用-w参数, 但是遇到-横杠却不好使

echo "a a-b a-b-c" | grep -E "a-b$|a-b[^-]" # 精确匹配 a-b
» 转载请注明来源:呢喃 » grep 精确匹配

Leave a Reply

Your email address will not be published. Required fields are marked *

four × 4 =