Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get ubuntu file timestamp in millisecond

Linux friends, how do you guys get a file timestamp in the resolution of milliseconds in Ubuntu? When I tried the command "stat" on my system, I get:

 File: `tmp.dat'
  Size: 14              Blocks: 8          IO Block: 4096   regular file
Device: 811h/2065d      Inode: 13895454    Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/    yqin)   Gid: ( 1004/     dev)
Access: 2010-09-27 09:04:44.000000000 -0400
Modify: 2010-09-25 13:54:58.000000000 -0400
Change: 2010-09-25 13:54:58.000000000 -0400

It seems that the resolution is only up to second. Any ideas? Thanks a lot.

like image 836
user459635 Avatar asked Sep 27 '10 15:09

user459635


1 Answers

That depends on the filesystem. fat will give you 2 second resolution. ext2 and ext3 are based on seconds. ext4 has nanoseconds (http://www.softpanorama.org/Internals/Filesystems/linux_ext2_ext3.shtml, search for "minimum timestamp resolution").

like image 107
Aaron Digulla Avatar answered Oct 15 '22 05:10

Aaron Digulla