About Unix File creation time


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers About Unix File creation time
# 1  
Old 11-16-2011
About Unix File creation time

Hello,
I registered and recreated this thread because everywhere we can see "It's not possible to get the file creation time in UNIX fs". This is not true any more with Ext4! Unfortunately, there is not user-level tools that allow you to read those information. You have to use a low level tool with root privileges to read the inode info:
Code:
sudo debugfs -R 'stat /path/to/file.txt' /dev/sda1

NOTE: Don't forget to change the path to the file and the disk device.

You will get something like this:
Code:
Inode: 1244660   Type: regular    Mode:  0644   Flags: 0x80000
Generation: 836126718    Version: 0x00000000:00000001
User:  1000   Group:  1000   Size: 2179
File ACL: 0    Directory ACL: 0
Links: 1   Blockcount: 8
Fragment:  Address: 0    Number: 0    Size: 0
 ctime: 0x4ebb2526:378a912c -- Thu Nov 10 11:13:10 2011
 atime: 0x4ec33d00:b6855780 -- Wed Nov 16 14:33:04 2011
 mtime: 0x4ebb2526:378a912c -- Thu Nov 10 11:13:10 2011
crtime: 0x4e8bf58c:05436980 -- Wed Oct  5 16:13:32 2011
Size of extra inode fields: 28
EXTENTS:
(0): 15383763

Reference: flyingunix DOT blogspot DOT com/2010/07/creation-time-in-unix-yes-in-ext4.html
# 2  
Old 11-17-2011
Thanks for sharing...
though only for linux... (Or is it not?)
I may change the thread's place to more suitable after discussing with others from the staff...

All the best
# 3  
Old 11-17-2011
Quote:
Originally Posted by gaellafond
Hello,
I registered and recreated this thread because everywhere we can see "It's not possible to get the file creation time in UNIX fs". This is not true any more with Ext4!
Interesting, though a touch inaccurate: Linux is not UNIX (by declaration, even, the GNU license means "GNU's Not Unix"), and this doesn't seem portable anywhere else.
# 4  
Old 11-21-2011
Thanks for this info Corona688 (and vbe),
Since Ext4 was part of the Kernel, I assumed it was a Unix FS. Obviously, I was wrong, it's only used with Linux. Sorry for the misunderstanding.
I don't know if it's true, but I read somewhere that only Ubuntu is currently shipped with Ext4 by default (the post might be a bit old, I don't remember). I suppose that's means that only Ubuntu can give you the creation time, as long as you don't explicitly choose Ext4 when you install Linux.
# 5  
Old 11-21-2011
Quote:
Originally Posted by gaellafond
Thanks for this info Corona688 (and vbe),
Since Ext4 was part of the Kernel, I assumed it was a Unix FS. Obviously, I was wrong, it's only used with Linux. Sorry for the misunderstanding.
I don't know if it's true, but I read somewhere that only Ubuntu is currently shipped with Ext4 by default (the post might be a bit old, I don't remember). I suppose that's means that only Ubuntu can give you the creation time, as long as you don't explicitly choose Ext4 when you install Linux.
That's probably a bit old by now. Ubuntu adopted it early.

Good to know there's a better reason than peer pressure to use ext4, though, but there's more important considerations than features when picking a filesystem.
  • Is it safe?
  • Is it sane?
  • Is it portable?
  • Can it recover from errors?
  • Will it grind down into a sticky mass after a few years of use?

The answers for ext3 are generally 'yes', 'yes', 'yes', 'yes', and 'no'. You can't say that for a lot of experimental or higher-performance filesystems. Some are untested, some are picky about how they're used, xfs fsck blows up on 32-bit, the kernel driver for reiserfs didn't compile right on 64-bit for a long time, ls on reiserfs3 can take 5 seconds of thrashing once you've used it 2 years, etc, etc, etc. Unless there's a high performance need you can count on ext3 not betraying you in these ways. So most maintainers were happy to wait and see if ext4 was all it was cracked up to be.

Last edited by Corona688; 11-21-2011 at 12:52 PM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Sftp file creation time

Hi Team, Could you please let me know ,how to find the file creation date time in SFTP server. i tred like , ls -ltr command only availble and not available like ls --full-time test.txt please help? Thanks (7 Replies)
Discussion started by: bmk123
7 Replies

2. Shell Programming and Scripting

Time take between first and last file creation

Hi , In a folder I have multiple files. I want total time taken to write those files. Can you please suggest what will be the best way to go for it? (2 Replies)
Discussion started by: Anupam_Halder
2 Replies

3. UNIX for Dummies Questions & Answers

File creation time in UNIX

Hi All, Can any one help how to long list today's files in unix.i.e files which are have been created today should be able to "ls -ltr" .I should be able to apply the "ls -ltr" command on today's files(should not include all the files which were there in the directory). Thanks in advance!!! (3 Replies)
Discussion started by: Balasankar
3 Replies

4. Red Hat

File creation time

Hi Everybody, I would like to know file creation date and time in linux. I went throgh google and forums got some information but from that i am not sure for my question. Please check the following information. "ls -l" ==> but it is just gives the last modified time and date of the file.... (2 Replies)
Discussion started by: mastansaheb
2 Replies

5. Shell Programming and Scripting

find file creation time

Hello folks, I have a file, but it change every seconds, i use stats command to check its creation time, but it shows access,modify and change time same. Is there any other way to see the file creation date/time? Thanks (2 Replies)
Discussion started by: learnbash
2 Replies

6. Shell Programming and Scripting

File creation time in seconds

Hi All, Cany any one help me in solving this.. Problem statement: I have a requirement to find the time from which there are no files created in a given directory. For this I am assuming that I need to get the file creation time in seconds, then the current time in seconds using `date +%s`.... (7 Replies)
Discussion started by: chary
7 Replies

7. Programming

File creation time

Hi Everybody, Is their any functions to find out the file creation time in 'C' (2 Replies)
Discussion started by: mr_manii
2 Replies

8. Shell Programming and Scripting

Unix File creation time

IS there any command to find the file creation time in Unix. (2 Replies)
Discussion started by: tinivt
2 Replies

9. Shell Programming and Scripting

Listing the creation date/time of a file in unix

Hi, I need the unix command which returns only the file name and its creation date/time in unix. I tried ls -l <filename>. But that is giving other details also which I do not want. Could anyone help me out? Thanks. (6 Replies)
Discussion started by: unipepper
6 Replies

10. UNIX for Dummies Questions & Answers

file creation time

i have to delete some files that were created on a particular date. is there any way to do that without affecting the files that were modified on the same date? (1 Reply)
Discussion started by: sskb
1 Replies
Login or Register to Ask a Question