Você pode usar sort
:
ls Zmx* | sort -k 1.7n -k 1.5,1.6n
ou
ls Zmx* | sort -t _ -k 2.3n -k 2,2.2n
Com um% final| tail -1
Da classificação do GNU:
-
comparison
:“[…] A pair of lines is compared as follows: sort compares each pair of fields, in the order specified on the command line, according to the associated ordering options, until a difference is found or no fields are left. […]”
-
index-sort-field
Veja também classificação POSIX .