Well, most of the other answers here relate to
sort -n
However, I'm not sure if this works for negative numbers. Here are the results that I get with sorting version 6.10 on Fedora 9.
Input file:
-0.907928466796875 -0.61614990234375 1.135406494140625 0.48614501953125 -0.4140167236328125
Output:
-0.4140167236328125 0.48614501953125 -0.61614990234375 -0.907928466796875 1.135406494140625
Which is clearly not ordered by numerical value.
Then, I think, a more accurate answer would be to use sort -n , but only if all values ββare positive.
PS: Using sort -g returns only the same results for this example
Edit:
It seems that the language settings affect how the minus sign affects the order ( see here ). To get the correct results, I simply did:
LC_ALL=C sort -n filename.txt
pgilmon Feb 12 '13 at 7:45 2013-02-12 07:45
source share