Operating System - HP-UX
1753511 Members
5475 Online
108795 Solutions
New Discussion юеВ

what is the difference betwenn atime, ctime and mtime in find command

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

Re: what is the difference betwenn atime, ctime and mtime in find command

Hi All,

Then how to find the original creation time of the file or directory.


Pete Randall
Outstanding Contributor

Re: what is the difference betwenn atime, ctime and mtime in find command

As JRF said, there is no such thing as creation time in Unix, therefore you can not find the creation time of a directory (unless it has never been modified).


Pete

Pete
Bob E Campbell
Honored Contributor

Re: what is the difference betwenn atime, ctime and mtime in find command

For many files m(odification) time will be the creation time. For directories look for the oldest modification time of contents (ls -lrt). In all cases, remember that the touch(1) command can set any time somebody wants. Use "man touch" for info.

If there are specific system files that interest you, there are many different logs that can tell you much about when events happened. For example, swlist(1m) can be used to list the times that software was installed:

# swlist -l product -a install_date
# Initializing...
# Contacting target "swa"...
#
# Target: swa:/
#

ACXX 200710041617.26
Accounting 200710010316.26
AppDiscMN 200710010316.31
Availability 200710010316.36
BLKONLY-MS 200710010713.39
BOOT-KBD 200710010713.39
BOOT-MOUSE 200710010713.39
Bastille 200710010316.37
C-ANSI-C 200710041617.26

Note that the modification times of the actual files may well be the times they were compiled back in the lab.
Kranti Mahmud
Honored Contributor

Re: what is the difference betwenn atime, ctime and mtime in find command

Hi Senthil,

how to find the original creation time of the file or directory.

You can't - it isn't stored anywhere.

Files have a last-modified time (shown by "ls -l"), 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.

The man page for "stat(2)" discusses this.

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!
isunrise_1
New Member

Re: what is the difference betwenn atime, ctime and mtime in find command

it's a easy question!
man find