Dan*_*dry 4 find regular-expression
我需要一个正则表达式来使用 withfind
来查找名称以给定字符串开头的所有文件,例如proc
.
我试过,find . -regex '^proc*'
但它没有给我任何结果。
-name 'proc*'
在这种情况下最好只使用,它使用通配符并仅搜索文件名(与-regex
搜索导致文件名的整个目录条目不同)。
如果你坚持使用-regex
,利用贪婪:
find . -type f -regex '.*/proc[^/]*$'
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
16402 次 |
最近记录: |