I want to find out the creation date of particular file, not modification date or access date.
I have tried with ls -ltrh
and stat filename
.
I want to find out the creation date of particular file, not modification date or access date. I have tried with |
||||
The POSIX standard only defines three distinct timestamps to be stored for each file: the time of last data access, the time of last data modification, and the time the file status last changed. That said, modern Linux filesystems, such as ext4, Btrfs and JFS, do store the file creation time (aka birth time), but use different names for the field in question ( As Craig Sanders and Mohsen Pahlevanzadeh pointed out, As Stephane Chazelas points out, some filesystems, such as ntfs-3g, expose the file creation times via extended file attributes. |
|||||||||||||
|
TLDR; Use You can extract the ext4 creation times on Fedora 19 systems. Here's mine:
It's clear that the inodes on my ext4 partitions have the creation time. Here's a shell script that determines the inode associated with a filename and then augments the NB: This is just a demo and hugely inefficient since a kernel module is created, loaded, and unloaded for every execution. This is also probably very fragile as no error checking is performed. A proper kernel API would be preferable, but this script could be made much more efficient and read the creation times of multiple files/inodes. [contents of stap_stat.sh]
Here's a demo:
|
||||
|
In theory, with GNU stat you could use In practice, most filesystems do not record that information and the linux kernel does not provide any way of accessing it. The closest you can get is the file's ctime, which is not the creation time, it is the time that the file's metadata was last changed. Linux Weekly News had an interesting article about this a few years back - http://lwn.net/Articles/397442/ |
|||
|
Difference between If you call Notes: |
||||
|
In OS X you can use
|
|||
|
In Anyway the file birth time is stored in
|
|||
|
stat(1)
. – 200_success Sep 18 '13 at 5:15stap
to retrieve creation times. – rickhg12hs Oct 15 '13 at 13:11