Monday, November 30, 2009

File creation time linux

[root@xyz ~]# date
Mon Nov 30 11:41:34 GMT 2009

[root@xyz ~]# dd if=/dev/zero of=/tmp/test2.img count=1 bs=1G
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB) copied, 0.973053 seconds, 1.1 GB/s

[root@xyz ~]# stat /tmp/test2.img
File: `/tmp/test2.img'
Size: 1073741824 Blocks: 2099208 IO Block: 4096 regular file
Device: 6803h/26627d Inode: 97636 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2009-11-30 11:41:39.000000000 +0000
Modify: 2009-11-30 11:41:39.000000000 +0000
Change: 2009-11-30 11:41:40.000000000 +0000

[root@xyz ~]# ls -l --full-time /tmp/test2.img
-rw-r--r-- 1 root root 1073741824 2009-11-30 11:41:39.000000000 +0000 /tmp/test2.img

**ls only displays last modified time
**"Access time" used by stat command is in fact file creation time. Precise definition would be time when linux operating system started creating the file.

No comments: