Operating System - HP-UX
1834302 Members
2795 Online
110066 Solutions
New Discussion

How to find the file creation date?

 
Jagadesh_2
Regular Advisor

How to find the file creation date?

Hi,

Please let me know how to find the file creation date?

Thanks in advance
S.Jagadesh
6 REPLIES 6
Patrick Wallek
Honored Contributor

Re: How to find the file creation date?

It is not really possible to nail down the creation time of a file.

You can find the last modification time (seen with ls -l), or last access time (ls -ut).

If you want to use find you can search with last acccess time (-atime), last change time (-ctime) or last modification time (-mtime).

Look at the ls and find man pages for more information.
Jagadesh_2
Regular Advisor

Re: How to find the file creation date?

Is it possible to get that via script.
Rick Garland
Honored Contributor

Re: How to find the file creation date?

Have something similar in the script;
ll -ut
time of last access, -u sorted with the -t option

Also find can help
find , -atime n -exec ll {} \;
(where 'n' is number of days)

man ll
man ls
man find

Mel Burslan
Honored Contributor

Re: How to find the file creation date?

The only way that I can think of is, if you have a daily backup procedure, is to scan the backup catalogs for that file and see where you encounter the earliest copy. Other than that, there is no way that I can think of, you can get the creation date.
________________________________
UNIX because I majored in cryptology...
Sandman!
Honored Contributor

Re: How to find the file creation date?

You can't - it isn't stored anywhere. Files have a last-modified time (shown by "ls -"), a last-accessed time (shown by "ls -lu") and an inode change time (shown by "ls -lc").The latter is often referred to as the "creation time" - even in some man pages - but that's wrong; it's also set by such operations as mv, ln, chmod, chown and chgrp.
Cheryl Griffin
Honored Contributor

Re: How to find the file creation date?

Sandman is right - the creation date is not stored in the inode, therefore you can't list that date.
"Downtime is a Crime."