Linux command to return all files that start with TEMP but do not end with double digits

fileslswildcards

What is the Linux command to return all files that start with TEMP but do not end with double digits?

I think it should look something like this:

ls -l TEMP*[!0-9][!0-9]

but the results of my search are omitting some results it seems.

Best Answer

With GNU and most modern BSDs find:

find . -maxdepth 1 -type f -name 'TEMP*' ! -name "*[0-9][0-9]"

POSIXly:

find . ! -name . -prune  -type f -name 'TEMP*' ! -name "*[0-9][0-9]"

ksh or bash -O extglob or zsh -o kshglob:

ls -ld TEMP*@([^0-9]?|?[^0-9]) [T]EMP TEMP?
Related Question