unix: when was a directory created

walla

Senior member
Jun 2, 2001
987
0
0
I would like to know if there is any way to determine when (at what time) a directory was created within Unix. I am well aware that the date listed using "ls -l" is the last-modification date. However I need proof about when it was actually created.

Thanks.

 

GprophetB

Platinum Member
Jun 20, 2003
2,632
0
76
you try ls -la ??

I dont have my laptop here right now and im on my desktop (Xp pro) But i think ls -la gives you a LOT of details.

give that a try really quick (im a unix newb but that may help you :) )
 

walla

Senior member
Jun 2, 2001
987
0
0
"ls -la" lists all files in the long format, which doesn't give me any new information.

I asked a unix admin where I work the same question by e-mail, I don't think he had a solution for me.

Is this possible?
 

walla

Senior member
Jun 2, 2001
987
0
0
Originally posted by: n0cmonkey
Which unix?

EDIT: It probably doesn't matter.
mtime: tells you when the data in the file was last altered
atime: tells when the data of a file was last accessed
ctime: tells when the inode was last changed

http://www.linuxdevcenter.com/pub/a/bsd/2001/03/07/FreeBSD_Basics.html

SunOS 5.9

The three functions you've listed are not found on this system. Perhaps I could petition for them to be installed if thats a possibility. However, regarding those functions...

1) Could "mtime" return a time that was before the time a file was created if via copy? If not, then I could deduce that a file was created no later than "mtime" which may serve my purpose.
2) What does "ctime" imply that the date given by "ls -l" does not?

Anyway, thanks for the info.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: walla
The three functions you've listed are not found on this system. Perhaps I could petition for them to be installed if thats a possibility. However, regarding those functions...

They aren't programs, just the data that is stored about the file on Solaris (and most unix and unix-like systems). I should have specified.

1) Could "mtime" return a time that was before the time a file was created if via copy? If not, then I could deduce that a file was created no later than "mtime" which may serve my purpose.
2) What does "ctime" imply that the date given by "ls -l" does not?

Anyway, thanks for the info.

I think ls -l gives you the mtime.
ls -lu gives the atime.
ls -cl gives the ctime.

Without any flags, cp uses a new mtime. I created a file called test. I let a minute pass and cp test test2. test2 had the new time, not the time when test was created. ls -ul gave the new time for both files.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I would like to know if there is any way to determine when (at what time) a directory was created within Unix. I am well aware that the date listed using "ls -l" is the last-modification date. However I need proof about when it was actually created.

You won't find it. The best you can do is ctime but that gets updated whenever the permissions change and if you have write access to the directory you can set the times to whatever you want with touch.