My CentOS box with: $ uname -r 2.6.18-164.6.1.el5
gets the file order wrong with: ls -lrt * . Two files that were last modified in the same second are shown in order that is the reverse of the order in which they were actually last modified. Note also that the later file was first created after the earlier file was last modified.
Is the precision of this only to the second?
Mike.
On Wed, Jun 09, 2010 at 03:06:30PM +0000, Michael D. Berger wrote:
ls -lrt *
Is the precision of this only to the second?
Yes. File timestamps are reported by the stat() call as time_t values, which are "seconds past 00:00:00 1/1/1970". So "ls" can only sort to a 1 second precision.