How to get ubuntu file timestamp in milliseconds

Friends of Linux, how do you guys get the file timestamp in millisecond resolution in Ubuntu? When I tried the "stat" command 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 a second. Any ideas? Many thanks.

+3
source share
1 answer

It depends on the file system. fatwill give you 2 second resolution. ext2and ext3based on seconds. ext4has nanoseconds ( http://www.softpanorama.org/Internals/Filesystems/linux_ext2_ext3.shtml , search for "minimum timestamp resolution").

+8
source

Source: https://habr.com/ru/post/1766789/


All Articles