0
I would like to use GNU sort to have the file names from a find
command sorted by the numbers in the name. The name of the file is "cycle" then the first number to sort by, then ".subset", then the second number to sort by, then "." then the third number to sort by. A simple sort does not work, since the first number can one one or more digits:
find /tmp/folder/ -name "cycle*" | sort
/tmp/folder/cycle10.subset1.2
/tmp/folder/cycle11.subset1.2
/tmp/folder/cycle12.subset1.2
/tmp/folder/cycle1.subset1.2
/tmp/folder/cycle2.subset1.2
/tmp/folder/cycle3.subset1.2
/tmp/folder/cycle4.subset1.2
/tmp/folder/cycle5.subset1.2
/tmp/folder/cycle6.subset1.2
/tmp/folder/cycle7.subset1.2
/tmp/folder/cycle8.subset1.2
/tmp/folder/cycle9.subset1.2
[...]
Any ideas?