I'm currently using this command to get a list of files :
find -E . -regex '.*\.(jpg|jpeg|png|gif|pdf)'
Using that command, I would get this list :
Now :
documentA.pdf
documentB.jpeg
001documentC.png
...
My aim is to filter this list, so I would only get files beginning with 3 integers and ending with the extensions previously set.
Goal :
001documentC.png
How can I tweak the command find -E . -regex so I would get such behaviour ? I have created a regex string : ([0-9][0-9][0-9]).*\.(jpg|jpeg|png|gif|pdf), tested on regexPal.com but I couldn't make it work with the find command.
find. What's yourfindversion? – iBug Mar 13 '17 at 12:28-Eoption mean? It doesn't work with myfind. – simlev Mar 13 '17 at 13:42man findthe whole path is checked, sofind . -regextype awk -regex '.*/[0-9][0-9][0-9].*\.(jpg|jpeg|png|gif|pdf)'works for me. – simlev Mar 13 '17 at 13:43find -E . -regex '.*/\d\d\d.*\.(jpg|jpeg|png|gif|pdf)'do you get an error message or just no files found? – simlev Mar 13 '17 at 19:11