I'm trying to sort the output of the md5sum program by file name, numerically (that is, file names all match log-\d+\.txt). I tried
sort -g "-t " -k 2 CHECKSUMS
but it sorts by checksum. Using
sort "-t " -k 2 CHECKSUMS
does sort by filename, but log-12.txt is placed before log-2.txt.
Any clues? Thanks!