Tags: -rw-r-r-, creation, creationdate, date, feb, file, itxxx, linux, programming, select, time, unix, updated, x85

How to check file creation date

On Programmer » Unix & Linux

12,954 words with 9 Comments; publish: Wed, 07 May 2008 05:29:00 GMT; (200125.00, « »)

ls -lt just select the file last updated date. How to check file creation

date and time ?

-rw-r--r-- 1 itxxx x85 4783481 Feb 8 09:36 1510208_finger_53.prn

All Comments

Leave a comment...

  • 9 Comments
    • moon wrote:

      > ls -lt just select the file last updated date. How to check file creation

      > date and time ?

      > -rw-r--r-- 1 itxxx x85 4783481 Feb 8 09:36 1510208_finger_53.prn

      You can't, it's not recorded.

      #1; Wed, 07 May 2008 05:30:00 GMT
    • In article <95cGf.54$ms5.4350.unix-linux.questionfor.info.ns2.gip.net>,

      "moon" <moon_ils-se.unix-linux.questionfor.info.yahoo.com.hk> wrote:

      > ls -lt just select the file last updated date. How to check file creation

      > date and time ?

      > -rw-r--r-- 1 itxxx x85 4783481 Feb 8 09:36 1510208_finger_53.prn

      Standard Unix file systems don't store creation time. The only times

      Unix stores for files are access time, modification time, and inode

      change time.

      Barry Margolin, barmar.unix-linux.questionfor.info.alum.mit.edu

      Arlington, MA

      *** PLEASE post questions in newsgroups, not directly to me ***

      *** PLEASE don't copy me on replies, I'll read them in the group ***

      #2; Wed, 07 May 2008 05:32:00 GMT
    • OK. How to Get those information ?

      "Barry Margolin" <barmar.unix-linux.questionfor.info.alum.mit.edu> wrote in message

      news:barmar-7BDC0C.21092407022006.unix-linux.questionfor.info.comcast.dca.giganews.com...

      > In article <95cGf.54$ms5.4350.unix-linux.questionfor.info.ns2.gip.net>,

      > "moon" <moon_ils-se.unix-linux.questionfor.info.yahoo.com.hk> wrote:

      >

      > Standard Unix file systems don't store creation time. The only times

      > Unix stores for files are access time, modification time, and inode

      > change time.

      > --

      > Barry Margolin, barmar.unix-linux.questionfor.info.alum.mit.edu

      > Arlington, MA

      > *** PLEASE post questions in newsgroups, not directly to me ***

      > *** PLEASE don't copy me on replies, I'll read them in the group ***

      #3; Wed, 07 May 2008 05:33:00 GMT
    • --BEGIN PGP SIGNED MESSAGE--

      Hash: SHA1

      Content rearranged for readability

      moon wrote:

      > "Barry Margolin" <barmar.unix-linux.questionfor.info.alum.mit.edu> wrote in message

      > news:barmar-7BDC0C.21092407022006.unix-linux.questionfor.info.comcast.dca.giganews.com...

      >

      > OK. How to Get those information ?

      You don't. Not unless you explicitly store it yourself somewhere.

      - --

      Lew Pitcher

      Master Codewright & JOAT-in-training | GPG public key available on request

      Registered Linux User #112576 (http://counter.li.org/)

      Slackware - Because I know what I'm doing.

      --BEGIN PGP SIGNATURE--

      Version: GnuPG v1.2.7 (GNU/Linux)

      iD8DBQFD6V0gagVFX4UWr64RAh3UAJwLUpMncVcP

      Cehs4ePb7MDL3RdvIQCgmoU3

      R7rb59VKd+TQxOBrSCMqXa8=

      =XCE/

      --END PGP SIGNATURE--

      #4; Wed, 07 May 2008 05:33:00 GMT
    • Lew Pitcher wrote:

      > --BEGIN PGP SIGNED MESSAGE--

      > Hash: SHA1

      > Content rearranged for readability

      > moon wrote:

      >

      >

      > You don't. Not unless you explicitly store it yourself somewhere.

      I think by "those information" he probably means one or more of access

      time, modification time, and inode change time. If so, he could take a

      look at "stat", "ls", GNU "find", etc...

      Ed.

      #5; Wed, 07 May 2008 05:35:00 GMT
    • "Lew Pitcher" <Lew.Pitcher.unix-linux.questionfor.info.tdsecurities.com> wrote in message news:kanGf.241

      63$1e5.497322.unix-linux.questionfor.info.news20.bellglobal.com...

      : Suresh wrote:

      : > moon wrote:

      : >> ls -lt just select the file last updated date. How to check file creati

      on

      : >> date and time ?

      : >> -rw-r--r-- 1 itxxx x85 4783481 Feb 8 09:36 1510208_finger_53.prn

      : > ANS

      : >

      : >

      : >

      : > ->As per the ur Query U can try this

      : > -> Example :Now I wnat to display the files which are created on Feb 8

      : >

      : > ->ls -lrt|grep "Feb 8"

      :

      : Which gets you the files that were /last modified/ on Feb 8, not files

      : that were /created/ on Feb 8.

      As a general point, you can't find a creation date for a file on

      UNIX because the cobcept is meaningless. You usually only see that

      question from mainframers where the creation date is the date the

      dataset was allocated. UNIX's filesystem is vastly different. What

      would you even choose for a creation date? The time the inode was

      allocated? What about tar then? You could have files with access and

      write times older than creation date. How about the time the directory

      entry was made? Well then, you'd have some linked files with

      multiple creation times.

      If you can't define what you want, of what good is it?

      Dan Mercer

      :

      :

      : --

      :

      : Lew Pitcher, IT Specialist, Corporate Technology Solutions,

      : Enterprise Technology Solutions, TD Bank Financial Group

      :

      : (Opinions expressed here are my own, not my employer's)

      #6; Wed, 07 May 2008 05:36:00 GMT
    • On 2006-02-10, Dan Mercer wrote:

      > "Lew Pitcher" <Lew.Pitcher.unix-linux.questionfor.info.tdsecurities.com> wrote in message news:kanGf.2

      4163$1e5.497322.unix-linux.questionfor.info.news20.bellglobal.com...

      >: Suresh wrote:

      >: > moon wrote:

      >: >> ls -lt just select the file last updated date. How to check file creat

      ion

      >: >> date and time ?

      >: >> -rw-r--r-- 1 itxxx x85 4783481 Feb 8 09:36 1510208_finger_53.pr

      n

      >: > ANS

      >: >

      >: > ->As per the ur Query U can try this

      >: > -> Example :Now I wnat to display the files which are created on Feb 8

      >: >

      >: > ->ls -lrt|grep "Feb 8"

      >:

      >: Which gets you the files that were /last modified/ on Feb 8, not files

      >: that were /created/ on Feb 8.

      > As a general point, you can't find a creation date for a file on

      > UNIX because the cobcept is meaningless.

      Not at all.

      > You usually only see that question from mainframers where the

      > creation date is the date the dataset was allocated.

      I worked on a system (8086, not mainframe, nor Unix) in which the

      creation dates were recorded. A file listing gave both creation

      time and modification times.

      > UNIX's filesystem is vastly different. What would you even choose

      > for a creation date?

      Take your pick. Once you have chosen, implement it.

      > The time the inode was allocated?

      Good idea.

      > What about tar then?

      _What_ about tar?

      > You could have files with access and write times older than creation

      > date.

      How?

      > How about the time the directory entry was made? Well then,

      > you'd have some linked files with multiple creation times.

      If that's what you want, then that can be implemented. If not, do

      it differently.

      > If you can't define what you want, of what good is it?

      Of course you can define it. You have to make a decision which of

      various possible definitions you are going to use.

      Chris F.A. Johnson, author | <http://cfaj.freeshell.org>

      Shell Scripting Recipes: | My code in this post, if any,

      A Problem-Solution Approach | is released under the

      2005, Apress | GNU General Public Licence

      #7; Wed, 07 May 2008 05:37:00 GMT
    • "Chris F.A. Johnson" <cfajohnson.unix-linux.questionfor.info.gmail.com> wrote in message news:mgkvb3-dlb

      .ln1.unix-linux.questionfor.info.teksavvy.com...

      : On 2006-02-10, Dan Mercer wrote:

      : >

      : > "Lew Pitcher" <Lew.Pitcher.unix-linux.questionfor.info.tdsecurities.com> wrote in message news:kanGf

      .24163$1e5.497322.unix-linux.questionfor.info.news20.bellglobal.com...

      : >: Suresh wrote:

      : >: > moon wrote:

      : >: >> ls -lt just select the file last updated date. How to check file cre

      ation

      : >: >> date and time ?

      : >: >> -rw-r--r-- 1 itxxx x85 4783481 Feb 8 09:36 1510208_finger_53.

      prn

      : >: > ANS

      : >: >

      : >: > ->As per the ur Query U can try this

      : >: > -> Example :Now I wnat to display the files which are created on Feb

      8

      : >: >

      : >: > ->ls -lrt|grep "Feb 8"

      : >:

      : >: Which gets you the files that were /last modified/ on Feb 8, not files

      : >: that were /created/ on Feb 8.

      : >

      : > As a general point, you can't find a creation date for a file on

      : > UNIX because the concept is meaningless.

      :

      : Not at all.

      :

      : > You usually only see that question from mainframers where the

      : > creation date is the date the dataset was allocated.

      :

      : I worked on a system (8086, not mainframe, nor Unix) in which the

      : creation dates were recorded. A file listing gave both creation

      : time and modification times.

      :

      : > UNIX's filesystem is vastly different. What would you even choose

      : > for a creation date?

      :

      : Take your pick. Once you have chosen, implement it.

      :

      : > The time the inode was allocated?

      :

      : Good idea.

      :

      : > What about tar then?

      :

      : _What_ about tar?

      :

      : > You could have files with access and write times older than creation

      : > date.

      :

      : How?

      Because tar preserves and restores file times unless you override

      the default behavior.

      And what happens on a move? You will get conflicting creation

      times depending on whether a file system was crossed.

      :

      : > How about the time the directory entry was made? Well then,

      : > you'd have some linked files with multiple creation times.

      :

      : If that's what you want, then that can be implemented. If not, do

      : it differently.

      :

      : > If you can't define what you want, of what good is it?

      :

      : Of course you can define it. You have to make a decision which of

      : various possible definitions you are going to use.

      And then you have to modify the filesystem to support it, as well

      as all filesystem utilities, system calls. And to what end.

      What will it tell you that is worth the effort of making the

      change? If you could come up with a reasonable definition and some

      concrete notion of how the creation time would be used, I suppose it

      could be rolled into the work effort when UNIX times go 64 bit

      (Thankfully, I should be retired by then). (Unless, of course,

      the powers that be simply don't decide to roll forward the

      epoch date to say, 2000 - a reasonable kludge.

      Dan Mercer

      :

      : --

      : Chris F.A. Johnson, author | <http://cfaj.freeshell.org>

      : Shell Scripting Recipes: | My code in this post, if any,

      : A Problem-Solution Approach | is released under the

      : 2005, Apress | GNU General Public Licence

      #8; Wed, 07 May 2008 05:38:00 GMT
    • --BEGIN PGP SIGNED MESSAGE--

      Hash: SHA1

      Dan Mercer wrote:

      > "Lew Pitcher" <Lew.Pitcher.unix-linux.questionfor.info.tdsecurities.com> wrote in message news:kanGf.2

      4163$1e5.497322.unix-linux.questionfor.info.news20.bellglobal.com...

      > : Suresh wrote:

      > : > moon wrote:

      > : >> ls -lt just select the file last updated date. How to check file crea

      tion

      > : >> date and time ?

      > : >> -rw-r--r-- 1 itxxx x85 4783481 Feb 8 09:36 1510208_finger_53.p

      rn

      > : > ANS

      > : >

      > : >

      > : >

      > : > ->As per the ur Query U can try this

      > : > -> Example :Now I wnat to display the files which are created on Feb

      8

      > : >

      > : > ->ls -lrt|grep "Feb 8"

      > :

      > : Which gets you the files that were /last modified/ on Feb 8, not files

      > : that were /created/ on Feb 8.

      > As a general point, you can't find a creation date for a file on

      > UNIX because the cobcept is meaningless.

      Agreed. As has been pointed out a couple of times upthread, including a hint

      at it in one of my posts.

      As for the grep, it still won't find files that were /created/ on Feb 8, bec

      ause

      1) the filesystem doesn't record file creation dates

      2) the ls command given isn't showing file creation dates (it is showing

      "last modification" dates, and

      3) there is no guarantee that the string "Feb 8" will appear exclusively in

      the file date field of the ls output; it /could/ be part of the filename.

      - --

      Lew Pitcher

      Master Codewright & JOAT-in-training | GPG public key available on request

      Registered Linux User #112576 (http://counter.li.org/)

      Slackware - Because I know what I'm doing.

      --BEGIN PGP SIGNATURE--

      Version: GnuPG v1.2.7 (GNU/Linux)

      iD8DBQFD7odXagVFX4UWr64RAm8uAKDIkbHjtKcy

      rmwzeyc6PiNTlFe17gCfXQPZ

      Zz7JUSCy79dnd26rbfL0w+8=

      =ZHMp

      --END PGP SIGNATURE--

      #9; Wed, 07 May 2008 05:39:00 GMT