<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic File creation/modification time in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/file-creation-modification-time/m-p/4158356#M90726</link>
    <description>I want to check a file name, whether it is created/modified within last x mins or not.&lt;BR /&gt;&lt;BR /&gt;How to do it?&lt;BR /&gt;&lt;BR /&gt;I must take into consideration about leap year, year changed etc.&lt;BR /&gt;&lt;BR /&gt;Rgds&lt;BR /&gt;-NKG-</description>
    <pubDate>Mon, 10 Mar 2008 10:46:26 GMT</pubDate>
    <dc:creator>Nitin Kumar Gupta</dc:creator>
    <dc:date>2008-03-10T10:46:26Z</dc:date>
    <item>
      <title>File creation/modification time</title>
      <link>https://community.hpe.com/t5/operating-system-linux/file-creation-modification-time/m-p/4158356#M90726</link>
      <description>I want to check a file name, whether it is created/modified within last x mins or not.&lt;BR /&gt;&lt;BR /&gt;How to do it?&lt;BR /&gt;&lt;BR /&gt;I must take into consideration about leap year, year changed etc.&lt;BR /&gt;&lt;BR /&gt;Rgds&lt;BR /&gt;-NKG-</description>
      <pubDate>Mon, 10 Mar 2008 10:46:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/file-creation-modification-time/m-p/4158356#M90726</guid>
      <dc:creator>Nitin Kumar Gupta</dc:creator>
      <dc:date>2008-03-10T10:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: File creation/modification time</title>
      <link>https://community.hpe.com/t5/operating-system-linux/file-creation-modification-time/m-p/4158357#M90727</link>
      <description>Use "touch" to create a reference file with the appropriate date/time value, then use the find command with the "-newer" option to compare if the files are more recent than your reference file.&lt;BR /&gt;&lt;BR /&gt;Do a man on touch and a man on find for specifics.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Mon, 10 Mar 2008 11:01:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/file-creation-modification-time/m-p/4158357#M90727</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2008-03-10T11:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: File creation/modification time</title>
      <link>https://community.hpe.com/t5/operating-system-linux/file-creation-modification-time/m-p/4158358#M90728</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;There is no such thing in UNIX as a "creation" timestamp.  The last modification ('mtime') is coincidently a creation at the instance that a file is first created.  Thereafter it is updated any time the file contents or offset change.&lt;BR /&gt;&lt;BR /&gt;That said, you can use 'find' to look for files meeting your criteria.  The '-mtime' argument is a 24-hour increment.  The '-newer' argument used with a "reference file" and 'touch' allows measurement from a preset point.&lt;BR /&gt;&lt;BR /&gt;Perl provides the easy way to compute a file age in units of seconds:&lt;BR /&gt;&lt;BR /&gt;# perl -le 'print "OK" if -e $ARGV[0] &amp;amp;&amp;amp; -M $ARGV[0] &amp;gt; (3600/86400)' file&lt;BR /&gt;&lt;BR /&gt;...would print "OK" if the file (name) passed as an argument to the Perl script were older than 3600/86400 of a day or older than 1-hour.  Granularity is in seconds so one-second would be 1/86400 of a day.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 10 Mar 2008 11:02:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/file-creation-modification-time/m-p/4158358#M90728</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-03-10T11:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: File creation/modification time</title>
      <link>https://community.hpe.com/t5/operating-system-linux/file-creation-modification-time/m-p/4158359#M90729</link>
      <description>Standard smarty pants line: Unix does not maintain a 'created time' for files.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Many ways to solve this&lt;BR /&gt;touch + find ... -newer is always handy.&lt;BR /&gt;&lt;BR /&gt;I use perl for just about everything.&lt;BR /&gt;It has a -M file function returning the Modified age for  a file in days&lt;BR /&gt;&lt;BR /&gt;In a verbose example:&lt;BR /&gt;&lt;BR /&gt;$  perl -le '$file = shift; $_ = ( 5/(24*60) &amp;lt; -M $file) ? "old" : "new"; print' &lt;YOUR-FILE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/YOUR-FILE&gt;</description>
      <pubDate>Mon, 10 Mar 2008 11:08:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/file-creation-modification-time/m-p/4158359#M90729</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2008-03-10T11:08:46Z</dc:date>
    </item>
  </channel>
</rss>

