sort the date

Hi All,

Please help me to sort the date field which is in the format 2012-02-03 16:09:37.388...
Platform: Red Hat linux

Thanks in advance

 
$ cat test.txt
2012-02-05 16:09:37.388
2012-02-03 16:09:37.388
2012-02-04 16:09:37.388
2012-02-01 16:09:37.388
2012-02-01 16:09:36.388

 
$ sort -n test.txt
2012-02-01 16:09:36.388
2012-02-01 16:09:37.388
2012-02-03 16:09:37.388
2012-02-04 16:09:37.388
2012-02-05 16:09:37.388

1 Like

Thanks ..
I got it......