LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 09-27-2012, 02:33 PM   #1
rmknox
Member
 
Registered: May 2010
Posts: 351

Rep: Reputation: 29
can i get creation date using ls?


F16 32 bit ls GnU 8.12

It appears that ls -l shows me the last modification date.
Is there a way to see the creation date of a file or directory?
Is this info stored in the file system?
If so, how does one access it?

Ive read 'man ls' and 'info ls' but they don't seem to tell
 
Old 09-27-2012, 02:47 PM   #2
mennohellinga
Member
 
Registered: Jun 2012
Location: Netherlands
Distribution: Archlinux
Posts: 72

Rep: Reputation: 38
From the ls man page:
Quote:
-l use the long listing format
A long listing of my home directory looks like this:
Code:
[21:44:03 ~]$ ls -l
total 24
-rw-r--r-- 1 mh users   41 Sep 17 12:22 agenda
-rw-r--r-- 1 mh users   56 Sep 27 13:34 authors
-rw-r--r-- 1 mh users   15 Sep 20 18:09 deps
drwxr-xr-x 2 mh users 4096 Sep 20 19:23 Desktop
drwxr-xr-x 8 mh users 4096 Sep 21 20:12 doc
-rw-r--r-- 1 mh users  143 Sep 21 17:23 mnemonic.mm
lrwxrwxrwx 1 mh users   19 Aug 31 00:21 VirtualBox VMs -> doc/VirtualBox VMs/
[21:44:06 ~]$
The output format is
Code:
type permissions owner-user owner-group size-in-bytes month-of-last-edit day-of-last-edit time-of-last-edit filename [-> link address]
 
Old 09-27-2012, 02:52 PM   #3
rmknox
Member
 
Registered: May 2010
Posts: 351

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by mennohellinga View Post
From the ls man page:


A long listing of my home directory looks like this:
Code:
[21:44:03 ~]$ ls -l
total 24
-rw-r--r-- 1 mh users   41 Sep 17 12:22 agenda
-rw-r--r-- 1 mh users   56 Sep 27 13:34 authors
-rw-r--r-- 1 mh users   15 Sep 20 18:09 deps
drwxr-xr-x 2 mh users 4096 Sep 20 19:23 Desktop
drwxr-xr-x 8 mh users 4096 Sep 21 20:12 doc
-rw-r--r-- 1 mh users  143 Sep 21 17:23 mnemonic.mm
lrwxrwxrwx 1 mh users   19 Aug 31 00:21 VirtualBox VMs -> doc/VirtualBox VMs/
[21:44:06 ~]$
Hi menn... - but is this the creation date or the last mod date? I bvelieve it is the last mod date. If so, how do I get the creation date?

The output format is
Code:
type permissions owner-user owner-group size-in-bytes month-of-last-edit day-of-last-edit time-of-last-edit filename [-> link address]
OK - thanks - but isn't this the last mod date? I want the creation date.
 
Old 09-27-2012, 02:54 PM   #4
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,168
Blog Entries: 23

Rep: Reputation: 275Reputation: 275Reputation: 275
Umm, I hate to break it to you, but as far as I know, you can't it does'nt seem to be stored anywhere. There is a last-modified time (shown by "ls -l"), a last-accessed time (shown by "ls -lu") and an inode change time (shown by "ls -lc")....sorry...

Thor
 
Old 09-27-2012, 03:07 PM   #5
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,374

Rep: Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911
The ext2/ext3 filesystems don't store the creation time of a file, but the last time at which the inode of the file has been updated. This is called "change time" usually named ctime. It reflects the time of creation until the access permissions or the ownership are not changed. For this reason you cannot trust this timestamp to reveal the creation date of a file. On the contrary the ext4 filesystem adds support for the storage of the true creation date, but as far as I know the libraries and utilities in Linux have not been updated in order to use it.

Regarding your question, you can visualize the "change time" using the stat command or the option -c of ls, e.g.
Code:
$ stat file
  File: `file'
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 808h/2056d      Inode: 3146149     Links: 1
Access: (0755/-rwxr-xr-x)  Uid: ( 1000/    alex)   Gid: (  100/   users)
Access: 2012-09-27 21:57:35.189775325 +0200
Modify: 2012-09-27 21:57:35.189775325 +0200
Change: 2012-09-27 22:07:05.726766177 +0200
$ ls -lc file
-rwxr-xr-x 1 alex users 0 Sep 27 22:07 file
keeping in mind it's not a creation date.

Edit: sorry Thor for the redudancy, I didn't see your post before submitting mine.

Last edited by colucix; 09-27-2012 at 03:09 PM.
 
Old 09-27-2012, 03:12 PM   #6
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,168
Blog Entries: 23

Rep: Reputation: 275Reputation: 275Reputation: 275
hey there, colucix, dont let it get to you, great minds eh? Anyway, it proves the point.

Wellness to all

Thor
 
Old 09-27-2012, 03:46 PM   #7
rmknox
Member
 
Registered: May 2010
Posts: 351

Original Poster
Rep: Reputation: 29
Colucix and Thor - thanks guys - another question

Colucix and Thor - thanks guys - in my case I took the defaults when I got onto Fedora f12 and have the logical volume file system (which I would not have picked if I had known) but anyway it is ext4 - thus presumably if I look up the file formats I could write a little utility to see the cration date?

Since you guys obviously know your stuff - maybe you can answer this one

Fedora f16 takes 1 minute longer to boot than my f14 - I see that in the process it created or modifies files and folders as follows:

tmpfs results in creating or updating 13 items with 671.1 MB
sysfs results in creating or updating 20,047 items with 192.5 Mb
proc results in creating or updating 39294 items

I gotta believe this is overkill for a single user desktop system - but dont know where to modify the startup

are there command files that control what happens in startup?

if so where do I read about them?
 
Old 09-27-2012, 04:06 PM   #8
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,168
Blog Entries: 23

Rep: Reputation: 275Reputation: 275Reputation: 275
Quote:
are there command files that control what happens in startup?
on Arch, these are located in /etc/rc.d/ the script /etc/rc.conf coverns most stuff...
By the way, careful what you wish for if you sc**w up startup scripts, you can basically end up with a dead system make backups of any and evertything you touch...

Maybe some info of the wiki can help...
One minute? That's still okay...do realise fedora keeps getting more complex. It's philosophy is different of, say, Arch, where the user controls the show...

Thor
Edit - it may do a fsck on bootup...that takes time too...

Last edited by Thor_2.0; 09-27-2012 at 04:07 PM.
 
Old 09-27-2012, 04:13 PM   #9
rmknox
Member
 
Registered: May 2010
Posts: 351

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by Thor_2.0 View Post
on Arch, these are located in /etc/rc.d/ the script /etc/rc.conf coverns most stuff...
By the way, careful what you wish for if you sc**w up startup scripts, you can basically end up with a dead system make backups of any and evertything you touch...

Maybe some info of the wiki can help...
One minute? That's still okay...do realise fedora keeps getting more complex. It's philosophy is different of, say, Arch, where the user controls the show...

Thor
Edit - it may do a fsck on bootup...that takes time too...
Super - needless to say I have a backup and a backup of the backup!
Thanks - will look into it
 
Old 09-27-2012, 04:30 PM   #10
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,168
Blog Entries: 23

Rep: Reputation: 275Reputation: 275Reputation: 275
Quote:
Super - needless to say I have a backup and a backup of the backup!
Wow, we dont need to tell you this! You're an example of how it has to be done, it seems. Most disasters can be avoided this way. I'll follow this thread, maybe I can learn something here

Thor
 
Old 09-27-2012, 05:02 PM   #11
rmknox
Member
 
Registered: May 2010
Posts: 351

Original Poster
Rep: Reputation: 29
Quote:
Originally Posted by Thor_2.0 View Post
Wow, we dont need to tell you this! You're an example of how it has to be done, it seems. Most disasters can be avoided this way. I'll follow this thread, maybe I can learn something here

Thor
Hi THor

I occurred to me to search the web and I found this - out of date but pretty detailed - looks like a good starting point

http://www.yolinux.com/TUTORIALS/Lin...itProcess.html
 
1 members found this post helpful.
Old 09-27-2012, 05:19 PM   #12
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,168
Blog Entries: 23

Rep: Reputation: 275Reputation: 275Reputation: 275
Talking Umm...

Umm, please tap me on the head ...this is the very first page (a long while ago) I found and learned about bootup...I should have given you this URL instead...I need to re-organise my bookmarks. Dated, perhaps, educational, yes.

Thanks for sharing this link!!!

Thor
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User creation date falconite Linux - Newbie 27 07-15-2010 05:50 PM
images creation date newer than last modified date fenrisW0lf Linux - Newbie 3 07-28-2009 05:04 PM
File creation date Jay5487 Linux - Newbie 2 03-25-2008 07:47 AM
file creation date prashantbhushan Linux - General 2 05-29-2007 08:32 AM
ls -al file creation date blackzone Linux - Newbie 2 08-23-2004 01:31 AM


All times are GMT -5. The time now is 07:50 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration