# 获取 Slave.err 的 Inode 码
[root@python slavemonitor]# stat Slave.err
File: ‘Slave.err’
Size: 208806 Blocks: 416 IO Block: 4096 regular file
Device: fd01h/64769d Inode: 2097509 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2022-05-13 10:29:12.580057359 +0800
Modify: 2022-05-13 10:04:21.208423148 +0800
Change: 2022-05-13 10:04:21.208423148 +0800
Birth: -
# 查看文件所在的磁盘
[root@python slavemonitor]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.6M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/vda1 40G 12G 26G 31% /
tmpfs 379M 0 379M 0% /run/user/0
# 使用 debugfs 查看文件详细信息,获取 crtime 创建时间
[root@python slavemonitor]# debugfs -R 'stat <2097509>' /dev/vda1
debugfs 1.42.9 (28-Dec-2013)
Inode: 2097509 Type: regular Mode: 0644 Flags: 0x80000
Generation: 2270275877 Version: 0x00000000:00000001
User: 0 Group: 0 Size: 208806
File ACL: 0 Directory ACL: 0
Links: 1 Blockcount: 416
Fragment: Address: 0 Number: 0 Size: 0
ctime: 0x627dbca5:31b123b0 -- Fri May 13 10:04:21 2022
atime: 0x627dc278:8a4be43c -- Fri May 13 10:29:12 2022
mtime: 0x627dbca5:31b123b0 -- Fri May 13 10:04:21 2022
crtime: 0x627a1b08:b91d4718 -- Tue May 10 15:58:00 2022
Size of extra inode fields: 28
EXTENTS:
(ETB0):8451326, (0-1):8437754-8437755, (2-3):8449822-8449823, (4-5):8449982-8449983, (6):8421389, (7):8451325, (8):8451794, (9-10):8451798-8451799, (11):8451803, (12):8451807, (13):8451811, (14):8451815, (15-16):8451818-8451819, (17):84
51823, (18-19):8451829-8451830, (20):8450431, (21):8451207, (22):8451809, (23):8451813, (24-25):8451834-8451835, (26):8451841, (27):8451847, (28-29):8451854-8451855, (30):8451860, (31-32):8451866-8451867, (33):8451873, (34):8451879, (35
-36):8451885-8451886, (37):8451892, (38-39):8451898-8451899, (40-41):8451905-8451906, (42-43):8451912-8451913, (44):8451919, (45):8451925, (46):8451931, (47):8451937, (48):8451943, (49):8451949, (50):8451955
Linux 获取文件的创建时间
最新推荐文章于 2023-11-15 14:10:41 发布