find with regex not working as expected
Solution 1:
From man 1 find
[emphasis mine]:
-regex pattern
File name matches regular expression pattern. This is a match on the whole path, not a search. For example, to match a file named./fubar3
, you can use the regular expression.*bar.
or.*b.*3
, but notf.*r3
.
So this will find something:
find . -regextype sed -regex ".*/1[2-5][0-9][0-9]"
Note [1][2-5][0-9][0-9]
you used covers the range 1200-1599. [1]
can be just 1
as in my example.