Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex linux下ls中数字的正则表达式_Regex_Bash_Ls - Fatal编程技术网

Regex linux下ls中数字的正则表达式

Regex linux下ls中数字的正则表达式,regex,bash,ls,Regex,Bash,Ls,我有几个文件,比如aa_1.txt、aa_6.txt、aa_9801234123.txt、aa_90.txt 我试着用 ll aa_[0-9]+.txt 列出它们并将它们排序为aa_1.txt、aa_6.txt、aa_90.txt、aa_9801234123.txt。但是它不起作用。管道ll通过egrep: ll | egrep "aa_[0-9]+.txt" 它不起作用。之后没有结果。@81235将grep更改为egrep@Rashmirathi thx。我需要逃过方括号吗?@Bohemi

我有几个文件,比如aa_1.txt、aa_6.txt、aa_9801234123.txt、aa_90.txt 我试着用

ll aa_[0-9]+.txt

列出它们并将它们排序为aa_1.txt、aa_6.txt、aa_90.txt、aa_9801234123.txt。但是它不起作用。

管道
ll
通过
egrep

ll | egrep "aa_[0-9]+.txt"

它不起作用。之后没有结果。@81235将
grep
更改为
egrep
@Rashmirathi thx。我需要逃过方括号吗?@Bohemian不,我不这么认为。解决了!我使用
ll-v*.txt | egrep“aa”[0-9]+.txt”