Reputation: 728
I am trying to find a file in Linux box. It ends with a timestamp pattern, e.g:
MY_TEST_FILE_1_003900.log
created as 39th minute, andMY_TEST_FILE_1_004201.log
created at 42nd minute and 1st second, etc.I tried finding this file using command:
find . -name "MY_TEST_FILE_1_[0-9][0-9][0-9][0-9][0-9][0-9].log" -print
and it listed all the log files for the day.
When I tried the same thing as:
find . -name "MY_TEST_FILE_1_[0-9]{6}.log" -print
I am not able to list any.
Could you please tell me where am I going wrong?
Upvotes: 1
Views: 74
Reputation: 53478
A shellglob pattern is not the same as a regex.
Try 'find -regex' instead.
Upvotes: 3