The following method helps you get the file creation time and date in linux shell.

root@linuxinternetworks# cat << _eof > test.txt
> Hello
> This is my test file
> _eof
root@linuxinternetworks# cat test.txt
Hello
This is my test file
root@linuxinternetworks# ls -i test.txt
2097517 test.txt
root@linuxinternetworks# debugfs -R ‘stat <2097517>’ /dev/sda5

Inode: 2097517 Type: regular Mode: 0664 Flags: 0×80000
Generation: 4245143992 Version: 0×00000000:00000001
User: 1000 Group: 1000 Size: 27
File ACL: 0 Directory ACL: 0
Links: 1 Blockcount: 8
Fragment: Address: 0 Number: 0 Size: 0
ctime: 0x50ea6d84:4826cc94 — Mon Jan 7 12:09:00 2013
atime: 0x50ea6d8e:75ed8a04 — Mon Jan 7 12:09:10 2013
mtime: 0x50ea6d84:4826cc94 — Mon Jan 7 12:09:00 2013
crtime: 0x5056d493:bbabf49c — Mon Sep 17 13:13:15 2012
Size of extra inode fields: 28
EXTENTS:
(0):8421789

where

atime: Last time file was opened or executed

ctime: Time the inode information was updated. ctime also gets updated when file is modified

mtime: Last modified time

crtime: File creation time


Subscribe Our Free Newsletter

Delivered by FeedBurner. We Respect Your Privacy

Tagged with:
 

Leave a Reply

%d bloggers like this: