How to get file creation date/time in Bash/Debian?

后端 未结 12 1752
有刺的猬
有刺的猬 2020-11-28 23:00

I\'m using Bash on Debian GNU/Linux 6.0. Is it possible to get the file creation date/time? Not the modification date/time. ls -lh a.txt and stat -c %y a.

12条回答
  •  一生所求
    2020-11-28 23:42

    ls -i file #output is for me 68551981
    debugfs -R 'stat <68551981>' /dev/sda3 # /dev/sda3 is the disk on which the file exists
    
    #results - crtime value
    [root@loft9156 ~]# debugfs -R 'stat <68551981>' /dev/sda3
    debugfs 1.41.12 (17-May-2010)
    Inode: 68551981   Type: regular    Mode:  0644   Flags: 0x80000
    Generation: 769802755    Version: 0x00000000:00000001
    User:     0   Group:     0   Size: 38973440
    File ACL: 0    Directory ACL: 0
    Links: 1   Blockcount: 76128
    Fragment:  Address: 0    Number: 0    Size: 0
     ctime: 0x526931d7:1697cce0 -- Thu Oct 24 16:42:31 2013
     atime: 0x52691f4d:7694eda4 -- Thu Oct 24 15:23:25 2013
     mtime: 0x526931d7:1697cce0 -- Thu Oct 24 16:42:31 2013
    **crtime: 0x52691f4d:7694eda4 -- Thu Oct 24 15:23:25 2013**
    Size of extra inode fields: 28
    EXTENTS:
    (0-511): 352633728-352634239, (512-1023): 352634368-352634879, (1024-2047): 288392192-288393215, (2048-4095): 355803136-355805183, (4096-6143): 357941248-357943295, (6144
    -9514): 357961728-357965098
    

提交回复
热议问题