gpt4 book ai didi

linux - 如何以毫秒为单位获取ubuntu文件时间戳

转载 作者:IT王子 更新时间:2023-10-29 00:59:29 41 4
gpt4 key购买 nike

Linux 的 friend 们,你们如何在 Ubuntu 中获取毫秒分辨率的文件时间戳?当我在我的系统上尝试命令“stat”时,我得到:

 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

分辨率好像只到秒。有任何想法吗?非常感谢。

最佳答案

这取决于文件系统。 fat 会给你 2 秒的分辨率。 ext2ext3 都是以秒为单位的。 ext4 具有纳秒( http://www.softpanorama.org/Internals/Filesystems/linux_ext2_ext3.shtml ,搜索“最小时间戳分辨率”)。

关于linux - 如何以毫秒为单位获取ubuntu文件时间戳,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3805201/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com