使用 GNU find -regex 查找长文件名
我正在尝试使用以下方法查找目录中的所有长文件名:
find . -regex './[^/]\{5,\}.txt'
根据 GNU find 文档,-regex 默认情况下使用 emacs regex。所以这应该给我所有长度超过 5 个字符的文件(不包括扩展名)。不幸的是它不起作用。它什么都不匹配。我尝试过这个主题的各种变体,但没有成功。有什么想法吗? GNU 是否发现根本不支持重复限定符?
I'm trying to find all long filenames in a directory using:
find . -regex './[^/]\{5,\}.txt'
According to the GNU find documentation, -regex uses emacs regex by default. So this should give me all files longer than 5 characters (excluding extension). Unfortunately it does not work. It matches nothing. I've tried various variations on this theme but to no avail. Any ideas? Does GNU find simply not support the repetition qualifier?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加
且无需转义
{
}
Add
and no need to escape
{
}
为什么这么复杂?
why so complicated?