In unix, there is no such a thing as the creation time.
There is a semantic problem here: If I have a file a.txt
first created on oct, 1st , and I create a new file by cp a.txt b.txt
on nov, 1st, what is the creation time of b.txt
? If you think about nov, 1st. think that I can
ln a.txt b.txt
rm a.txt
and have the same final effect: b.txt
contains exactly the data of a.txt
, but the metadata linking to the content is created on nov, 1st...
It will heavily depend on the filesystem where you have your files stored. Unix-type file system (like all the default linux file system --- ext4, etc.) have no metadata for the first creation date. If you see the manual page for fstat(2)
, you can see that the data for files is:
time_t st_atime; /* time of last access */
time_t st_mtime; /* time of last modification */
time_t st_ctime; /* time of last status change */
There is an old ongoing confusion on that ctime
means creation time
(as it is on some MS-DOS derived file system) but in unix there is no such a thing as the first time of creation of a file.
So no, in normal unix filesystem you do not have the creation time. You just have the last metadata modification time.