3

I'm trying to find all files on linux that would match files like these:

frontend_prod_20100112.log
frontend_prod_20110101.log
frontend_prod_20120101.log
frontend_prod_20121231.log

the only variable here is 8 digits inside (exactly 8). I'm trying to run:

find . -regex ".*frontend_prod_[0-9]{8}\.log"

or

find . -regex ".*frontend_prod_(\d){8}\.log"

but it doesn't work.

Thanks for any help.

ducin
  • 25,621
  • 41
  • 157
  • 256

1 Answers1

3

Since this is POSIX, you need a slightly different syntax:

find . -regex ".*frontend_prod_[0-9]\{8\}\.log"
Tim Pietzcker
  • 328,213
  • 58
  • 503
  • 561