Question: If I have 10 files called 01-a.txt, 02-a.txt,...10-a.txt - how can I find the files where the number is greater than 5? I would like a general solution, and I would be putting the contents of all files into one file using something like

```
cat *.txt > bigfile.txt

```

I can get files with numbers using

```
ls *[0-9]*

```

but can't seem go beyond that.

thanks.

Answer: 
It will cat all files named as "< numeric\_value >-< rest >" and having this < numeric\_value > greater than `$LIM`.

Even if they are written with one single digit (like *5*), with two digits (like *05*), or more...

And even if the < rest > are different among the files.

```
LIM=5
for file in $(ls);
do
   number=$(echo $file | cut -f1 -d'-');
   [ $number -gt $LIM ] && cat $file >> bigfile.txt;
done

```
```
ls *.txt | perl -n -e '$f = $_; $f =~ s/\D//g; $f > 5 and print'

```