
Keep in mind that sort will still sort things in the way I described above, you will still need to pad file-names if they aren't equal in length. I'll leave mine because it add something, but you should use his solution, mp3wrap output.mp3 `ls -1 *.mp3 | sort`

If they aren't, you will need to pad the file names: Bash script to pad file names on StackOverflow explains how to do it.Įdit. This nifty line of bash script will let you visually compare the file names, making it very easy to spot any mistakes: for f in $(ls) do printf "%05s\n" "$f" done So, yes it will but you need to make sure that all your files are 'padded' properly. They are text files that contain their own file names: test$ cat *

I've got a directory with files named 1, 2, 3, 04, 05, and 06. That means that "01" comes before "1", since nought has a lower value than one. It does an alphabetical sort based on single characters.
