# as filenames aren't necessarily the same length, pad them all to be so (bearing in mind it's right padding, as it's implied that it's 0.x) ls *png|sed 's/.png//g'|awk -F _ '{p = $3; while(length(p) < 18) {p = p "0"} ; printf("%s %s.png\n", p, $0)}'|sort -n|less