1833041 Members
2444 Online
110049 Solutions
New Discussion

file creation time

 
so_2
Regular Advisor

file creation time

Hi All

Is there any command to know when do a file is actually created (not modified)?

Thanks and regds


S.O
7 REPLIES 7
Muthukumar_5
Honored Contributor

Re: file creation time

We may not find file creation time in *NIX platforms.

See this:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=203044
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=832810

--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: file creation time

Hi SO,

It is not possible to find out the creation time as UNIX doesn't provide anyways to do that.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
James George_1
Trusted Contributor

Re: file creation time

Hi

Not sure .. but looking # man ll is worth.

See the option -c !!!

Rgds / James
forum is for techies .....heaven is for those who are born again !!
Pete Randall
Outstanding Contributor

Re: file creation time

James,

The -c option just sorts on time of last modification.


Pete

Pete
A. Clay Stephenson
Acclaimed Contributor

Re: file creation time

UNIX does not carry that metadata. The only way to do this is to somehow include this data in the file itself. The most straightforward way is to include a datestamp in the filename itself. If you choose to do so then you should encode UTC times rather than local times because you don't want TZ settings to add to the confusion. Another approach is to simply include the epoch seconds in the filename.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: file creation time

Hi:

You have three timestamps held in file's inode.

The 'mtime' is the modification time. This only equals a creation time when the file is created. Thereafter, writes to the file change this value.

The 'atime' is the last access timestamp -- when a file was read or executed.

The 'ctime' is the last *change* of the inode. Changing a file's permissions, its ownership, its name, or modifying the 'mtime' and/or 'atime' with 'touch' alter the 'ctime'.

Using 'ls -l' reports the 'mtime.

Using 'ls -ul' reports the "use" time or 'atime'.

Using 'ls -cl' reports the "change" time or 'ctime'.

Regards!

...JRF...
so_2
Regular Advisor

Re: file creation time

Hi All

Really helping replies from all. Clossing the thread and points have been assigned to everyone.

thanks and regds
S.O