I'm trying to do a search on a directory to find just the files that have a number as the extension (i.e. file.12345, file2.23415, file3.85472). Is there any way to do this in unix. I have been trying to find a way using the find command and wildcards, such as:
find . -name \*.#####
where the # is a wildcard for a single number or even a string of numbers, however, there doesn't seem to be anything like this that I can find, so are there any other suggestions. I am a fairly basic user of unix, but anything would help. Thank you.
Try using find . -print | grep -E '\.[0-9]+$'.
How about something like this?
find . -regex '.+\.[0-9]+'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With