<?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 Re: delete based in timestamp in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/delete-based-in-timestamp/m-p/3885924#M25720</link>
    <description>Hi,&lt;BR /&gt;please be aware that find will also search through sub-directories !</description>
    <pubDate>Wed, 25 Oct 2006 06:41:36 GMT</pubDate>
    <dc:creator>Peter Godron</dc:creator>
    <dc:date>2006-10-25T06:41:36Z</dc:date>
    <item>
      <title>delete based in timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/delete-based-in-timestamp/m-p/3885922#M25718</link>
      <description>Red Hat Enterprise Linux&lt;BR /&gt;&lt;BR /&gt;How can I delete files based in its timestamp.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;Delete all files older than October 23, 16:35 Hrs.</description>
      <pubDate>Tue, 24 Oct 2006 17:24:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/delete-based-in-timestamp/m-p/3885922#M25718</guid>
      <dc:creator>Tonatiuh</dc:creator>
      <dc:date>2006-10-24T17:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: delete based in timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/delete-based-in-timestamp/m-p/3885923#M25719</link>
      <description>Create a reference file with the touch -t command and set the time that you want. Then use the find command:&lt;BR /&gt;&lt;BR /&gt;touch -t YYYYMMDDhhmm.ss /tmp/referencefile&lt;BR /&gt;find /path -type f ! -newer /tmp/referencefile -exec rm {} \;</description>
      <pubDate>Tue, 24 Oct 2006 18:05:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/delete-based-in-timestamp/m-p/3885923#M25719</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2006-10-24T18:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: delete based in timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/delete-based-in-timestamp/m-p/3885924#M25720</link>
      <description>Hi,&lt;BR /&gt;please be aware that find will also search through sub-directories !</description>
      <pubDate>Wed, 25 Oct 2006 06:41:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/delete-based-in-timestamp/m-p/3885924#M25720</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-10-25T06:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: delete based in timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/delete-based-in-timestamp/m-p/3885925#M25721</link>
      <description>your delete operation is based on creation or modification date?</description>
      <pubDate>Thu, 26 Oct 2006 09:13:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/delete-based-in-timestamp/m-p/3885925#M25721</guid>
      <dc:creator>Andrea Rossi</dc:creator>
      <dc:date>2006-10-26T09:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: delete based in timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/delete-based-in-timestamp/m-p/3885926#M25722</link>
      <description>Hi Andrea,&lt;BR /&gt;&lt;BR /&gt;Is any difference between creation and modification timestamp?&lt;BR /&gt;&lt;BR /&gt;How can I see this two dates of same file?</description>
      <pubDate>Thu, 26 Oct 2006 10:06:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/delete-based-in-timestamp/m-p/3885926#M25722</guid>
      <dc:creator>Tonatiuh</dc:creator>
      <dc:date>2006-10-26T10:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: delete based in timestamp</title>
      <link>https://community.hpe.com/t5/operating-system-linux/delete-based-in-timestamp/m-p/3885927#M25723</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;You asked, "Is any difference between creation and modification timestamp?"&lt;BR /&gt;&lt;BR /&gt;There is *NO* creation timestamp for a file in Unix.&lt;BR /&gt;&lt;BR /&gt;You have three timestamps associated with a file.  The 'mtime' is the last modification time.  When a file is first created, its 'mtime' would represent a creation time, but any subsequent write to the file updates the 'mtime'.&lt;BR /&gt;&lt;BR /&gt;The second timestamp is the last-access time ('atime') which is as the name suggests, the last time a file was read, written or executed.&lt;BR /&gt;&lt;BR /&gt;The last timestamp is the 'ctime' or change-time.  Altering a file's permissions, ownership or changing its name updates this timestamp.&lt;BR /&gt;&lt;BR /&gt;All three timestamps are in Epoch seconds --- the number of seconds elapsed since January 1, 1970.&lt;BR /&gt;&lt;BR /&gt;Ivan has already shown hou you can delete files older than a specific date.  I would suggest, however, that you optimize:&lt;BR /&gt;&lt;BR /&gt;# find /path -type f ! -newer /tmp/referencefile -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;...to:&lt;BR /&gt;&lt;BR /&gt;# find /path -xdev -type f ! -newer /tmp/referencefile -exec rm {} +&lt;BR /&gt;&lt;BR /&gt;...if your Unix version supports it, or:&lt;BR /&gt;&lt;BR /&gt;# find /path -xdev -type f ! -newer /tmp/referencefile | xargs rm&lt;BR /&gt;&lt;BR /&gt;The last two cases assemble many filenames into a list that is then passed to the 'rm' process.  The first case means that a new 'rm' process will be spawned for *every* file found.  Needless to say, creating many processes is far more resource intensive then creating merely a few.  With large numbers of files to remove you could easily measure the time in minutes versus seconds!&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Oct 2006 08:16:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/delete-based-in-timestamp/m-p/3885927#M25723</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-10-27T08:16:57Z</dc:date>
    </item>
  </channel>
</rss>

