![使用正则表达式查找命令](https://linux22.com/image/916319/%E4%BD%BF%E7%94%A8%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E6%9F%A5%E6%89%BE%E5%91%BD%E4%BB%A4.png)
我正在练习一个find
命令和时刻,并且对命令中正则表达式的用法感到好奇find
(类似于grep
)。该命令是否支持它?如果是,启用它的选项有哪些?
我尝试在网页中寻找它man
,但至今没有成功。
答案1
从man find:
-regex pattern
File name matches regular expression pattern. This is a match
on the whole path, not a search. For example, to match a file
named `./fubar3', you can use the regular expression `.*bar.' or
`.*b.*3', but not `f.*r3'. The regular expressions understood
by find are by default Emacs Regular Expressions, but this can
be changed with the -regextype option.