View Single Post
  #1   (View Single Post)  
Old 11th April 2009
gosha gosha is offline
Spam Deminer
 
Join Date: Jun 2008
Location: China
Posts: 256
Default ls sorting of numbered files

I don't really know where I should post this, but I remember Windows has the same behaviour, so I'm here.
Say I have some files named: 1 2 10 11 20
This is the order you expect, right?
Code:
$ ls
1  10 11 2  20
I have solved this in the past and present putting a zero in front of units, but I'm sure there's a better way to sort the files in the proper way. Is there?
Reply With Quote