Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Sort ls output in true numerical order' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Sort ls output in true numerical order
Authored by: ceilingcat on Apr 30, '09 03:18:01PM
not sure if the sort command has changed since the original posts. It doesn't seem to work for me. Using -n I would get
ls | sort -n +0.4
sort: open failed: +0.4: No such file or directory
I looked around a bit and the following seemed to work.
ls | sort -n -k1.5
Where the parameters following -k means the 1st field and starting with the 5th character.

[ Reply to This | # ]