According to How to find creation date of file?, in Linux filesystems, such as ext4, Btrfs and JFS, that store the file creation time (aka birth time), it is possible to display the file birth time (in human-readable format) with the following command
stat -c '%w' approved-images.txt
2019-12-04 16:50:21.539553500 +0000
(Note that on Linux this requires coreutils
8.31, glibc
2.28 and kernel version 4.11 or newer.)
But 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.
Also in the POSIX standard of find
, there is no mention of the creation date of files.
For filesystems that store the creation date, is there a way of finding files whose birth date is after a given timestamp in a way that works in bash, dash and zsh shells??
Edit: As commented by JdeBP, in Is there really no way in Linux to get creation time for files on cifs/smb share? and Is there still no Linux kernel interface to get file creation date? there already have been extensive discussions related with this question.
And, as commented by Stéphane Chazelas, in Remove all files created before a certain date is stated that some BSDs have find -newerBt
to check the file's inode birth time.
coreutils
, and kernel versions, for instance, which are a Linux thing. So even if you just want Linux, that will still be limited to those systems with the right versions, which would make it non-portable again. So please define the scope of the question more clearly.struct stat
, Solaris ZFS has it (under the namecrtime
) in theextended attributes
and as a result the way to retrieve this value is totally platform dependent.