I'm trying to use the sort command (5.97) to sort one column of data and then another.
Right now, I'm doing:
> ls test/2/*.jpg | sort -t- -k1 -g -s
test/2/0-0.jpg
test/2/0-10.jpg
test/2/0-1.jpg
test/2/0-2.jpg
test/2/0-3.jpg
test/2/0-4.jpg
test/2/0-5.jpg
test/2/0-6.jpg
test/2/0-7.jpg
test/2/0-8.jpg
test/2/0-9.jpg
test/2/1-0.jpg
test/2/1-10.jpg
test/2/1-1.jpg
test/2/1-2.jpg
test/2/1-3.jpg
test/2/1-4.jpg
test/2/1-5.jpg
test/2/1-6.jpg
test/2/1-7.jpg
test/2/1-8.jpg
test/2/1-9.jpg
test/2/2-0.jpg
test/2/2-10.jpg
test/2/2-1.jpg
test/2/2-2.jpg
test/2/2-3.jpg
test/2/2-4.jpg
test/2/2-5.jpg
test/2/2-6.jpg
test/2/2-7.jpg
test/2/2-8.jpg
test/2/2-9.jpg
But as you can see, the two digit numbers are in the wrong spot. Is there a way to do this with sort?
