I have been trying to create a find command string that will find all files that end with a number 1-99 but exclude all others.e.g. I want to find myfile1 myfile99 but not myfile456 and not myfilebackupThe regex I'm thinking of is myfile[1-9]{1,2} but I can't get this to work with find.find . -regex '.*myfile[0-9]{1,2}'OR find . -iname 'myfile[0-9]{1,2}'From what I can see it's the {1,2} part that is not working.(by the way can you use -name -regex interchangably?)Any help appreciated.
find command with regex quantifier e.g. {1,2}
bash;find;regular expression
You could try find . -regex '.*myfile[0-9][0-9]?'orfind . \( -name myfile[0-9][0-9] -o -name myfile[0-9] \)