http://qs1969.pair.com?node_id=637223


in reply to Command line file sorting

*nix :
dirdata:
dir-100-1
dir-100-10
dir-100-2
dir-100-9
dir-100-99
dir-2-1
dir-28-1
dir-29-1
dir-29-2
dir-30-1
dir-3-1
Sorting: sort -rnt - -k2 -k3 dirdata <br> Selecting 2nd entry: sort -rnt - -k2 -k3 dirdata | head -2 | tail -1