o File creation time in Linux : How to get ?? | SYSADMINSHARE SYSADMINSHARE: File creation time in Linux : How to get ?? File creation time in Linux : How to get ?? | SYSADMINSHARE

File creation time in Linux : How to get ??




 
Linux does not have file creation time history until EXT3. In EXT4 this extra feature is there.

First get the inode for the file for which you want to get creation time.

# ls -i file_name

135528  //inode for this file

#debugfs -R 'stat <135528>' /dev/sda1

crtime 0x3f1cacc966104fc -- Tue May 27 16:35:28 2012

>> Now you could see the file creation time.



Linux or any Unix flavors, there are 3 time stamps:

1. atime : The last time file was opened or executed
2. ctime : The time the inode information was updated (chmod, chown etc does that). ctime also gets updated when file is modified
3. mtime: The time file was closed after it was opened for write

Command to see atime # ls -lu
Command to see ctime # ls -lc
Command to see mtime # ls -l

in EXT 4 - crtime will give creation time stamp.

you can use stat command to get the above 3 time stamps.(atime, mtime , ctime)

# stat myfile

 File: `myfile'
 Size: 41              Blocks: 8          IO Block: 4096   regular file
Device: fd04h/64772d    Inode: 655406      Links: 1
Access: (0777/-rwxrwxrwx)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2012-07-30 13:06:26.000000000 +0100
Modify: 2012-07-30 13:06:26.000000000 +0100
Change: 2012-07-30 13:06:46.000000000 +0100







Share your views...

0 Respones to "File creation time in Linux : How to get ??"

Post a Comment

 

About Me


               I'm Madeswaran N. I started this blog to share my work experience and spread some smart solutions on Unix / Linux. You can find SaS in facebook and twitter. Please share your valuable feedbacks after read. Thanks for Visit !!

Search This Blog

Loading...