更新时间:2022-06-08 22:21:50
使用标记 -F
搜索固定字符串-而不是正则表达式。从 man grep
:
Use the flag -F
to search for fixed strings -- instead of regular expressions. From man grep
:
-F, --fixed-strings
Interpret PATTERN as a list of fixed strings, separated by
newlines, any of which is to be matched. (-F is specified by
POSIX.)
例如:
$ grep -F "ab*c" <<< "ab*c"
ab*c