如何查找名称以一定数量数字开头的文件? [英] How to find a files which names start with a certain amount of digits?

查看:24
本文介绍了如何查找名称以一定数量数字开头的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按名称查找文件,例如至少以三位数字开头的文件.

I am trying to locate files by name, ones that start with at least three digits for example.

找到.-type f -name [0-3]* 将查找以最多 3 个数字开头的文件,但不会查找名称开头的三位数字符串.

find . -type f -name [0-3]* will find files starting with numbers up to 3, but not with a string of three digits at the start of the name.

任何人都可以提供一些见解?

Anyone can shed some insight?

推荐答案

如果要 3 个数字,必须指定要 0-9 之间的 3 个字符

If you want 3 digits, you have to specify you want 3 characters between 0-9

find . -type f -name "[0-9][0-9][0-9]*"

这篇关于如何查找名称以一定数量数字开头的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆