TOC

Linux 文件创建时间

stat /tmp/edge_shutdown_crash.txt
  文件:/tmp/edge_shutdown_crash.txt
  大小:2          块:8          IO 块:4096   普通文件
设备:801h/2049d   Inode:9306564     硬链接:1
权限:(0664/-rw-rw-r--)  Uid:( 1000/ markjour)   Gid:( 1000/ markjour)
最近访问:2021-12-12 10:24:17.318846619 +0800
最近更改:2021-12-12 10:42:27.982887293 +0800
最近改动:2021-12-12 10:42:27.982887293 +0800
创建时间:2021-12-12 10:24:17.318846619 +0800

# %w     time of file birth, human-readable; - if unknown
# %W     time of file birth, seconds since Epoch; 0 if unknown
# %x     time of last access, human-readable
# %X     time of last access, seconds since Epoch
# %y     time of last data modification, human-readable
# %Y     time of last data modification, seconds since Epoch
# %z     time of last status change, human-readable
# %Z     time of last status change, seconds since Epoch
stat -c "%w" /tmp/edge_shutdown_crash.txt
2021-12-12 10:24:17.318846619 +0800

sudo debugfs -R 'stat /tmp/edge_shutdown_crash.txt' /dev/sda1 | cat
debugfs 1.46.3 (27-Jul-2021)
Inode: 9306564   Type: regular    Mode:  0664   Flags: 0x80000
Generation: 3654863154    Version: 0x00000000:00000001
User:  1000   Group:  1000   Project:     0   Size: 2
File ACL: 0
Links: 1   Blockcount: 8
Fragment:  Address: 0    Number: 0    Size: 0
 ctime: 0x61b56193:ea56adf4 -- Sun Dec 12 10:42:27 2021
 atime: 0x61b55d51:4c04da6c -- Sun Dec 12 10:24:17 2021
 mtime: 0x61b56193:ea56adf4 -- Sun Dec 12 10:42:27 2021
crtime: 0x61b55d51:4c04da6c -- Sun Dec 12 10:24:17 2021
Size of extra inode fields: 32
Inode checksum: 0xd223c644
EXTENTS:
(0):39635628