<?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: find command: How to find the oldest file in a folder in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230892#M51920</link>
    <description>this work too&lt;BR /&gt;&lt;BR /&gt;ls -lrt | head -2</description>
    <pubDate>Thu, 18 Mar 2010 13:52:39 GMT</pubDate>
    <dc:creator>KarloChacon</dc:creator>
    <dc:date>2010-03-18T13:52:39Z</dc:date>
    <item>
      <title>find command: How to find the oldest file in a folder</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230890#M51918</link>
      <description>Hi Guys&lt;BR /&gt;&lt;BR /&gt;How to find the oldest file in a folder only with a method based on the find command ?&lt;BR /&gt;&lt;BR /&gt;bests regards&lt;BR /&gt;Den</description>
      <pubDate>Thu, 18 Mar 2010 12:28:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230890#M51918</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2010-03-18T12:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: find command: How to find the oldest file in a folder</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230891#M51919</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] based on the find command ?&lt;BR /&gt;&lt;BR /&gt;Why use "find"?&lt;BR /&gt;&lt;BR /&gt;      ls -1t | tail -1</description>
      <pubDate>Thu, 18 Mar 2010 13:49:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230891#M51919</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-03-18T13:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: find command: How to find the oldest file in a folder</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230892#M51920</link>
      <description>this work too&lt;BR /&gt;&lt;BR /&gt;ls -lrt | head -2</description>
      <pubDate>Thu, 18 Mar 2010 13:52:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230892#M51920</guid>
      <dc:creator>KarloChacon</dc:creator>
      <dc:date>2010-03-18T13:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: find command: How to find the oldest file in a folder</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230893#M51921</link>
      <description>&lt;!--!*#--&gt;&amp;gt; this work too&lt;BR /&gt;&lt;BR /&gt;Try it with "-1rt" instead of "-lrt".&lt;BR /&gt;                   one                       ell&lt;BR /&gt;&lt;BR /&gt;Unless you really want more than the name.</description>
      <pubDate>Thu, 18 Mar 2010 14:03:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230893#M51921</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-03-18T14:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: find command: How to find the oldest file in a folder</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230894#M51922</link>
      <description>but if you really need only files and not directories&lt;BR /&gt;&lt;BR /&gt;since my previous ls -lrt | head -2 list the file or directory that is the oldest or the 2 oldest if you modify head to -3 or -4 and so on&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;to list the oldest file only&lt;BR /&gt;&lt;BR /&gt;#ls -lrt | grep -v ^d | head -2</description>
      <pubDate>Thu, 18 Mar 2010 14:05:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230894#M51922</guid>
      <dc:creator>KarloChacon</dc:creator>
      <dc:date>2010-03-18T14:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: find command: How to find the oldest file in a folder</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230895#M51923</link>
      <description>&lt;!--!*#--&gt;&amp;gt; but if you really need [...]&lt;BR /&gt;&lt;BR /&gt;As usual, what we really need most is a&lt;BR /&gt;complete description of the problem to be&lt;BR /&gt;solved.&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] | head -2&lt;BR /&gt;&lt;BR /&gt;Still shows "total xxxx" along with the&lt;BR /&gt;desired information.  "| tail -1" could solve&lt;BR /&gt;that, but then why use "head" at all?</description>
      <pubDate>Thu, 18 Mar 2010 14:21:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230895#M51923</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-03-18T14:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: find command: How to find the oldest file in a folder</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230896#M51924</link>
      <description>ok sorry Steven sometimes I'm  not perfect&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#ls -gt | grep -v ^d | tail -1</description>
      <pubDate>Thu, 18 Mar 2010 15:40:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230896#M51924</guid>
      <dc:creator>KarloChacon</dc:creator>
      <dc:date>2010-03-18T15:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: find command: How to find the oldest file in a folder</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230897#M51925</link>
      <description>&lt;!--!*#--&gt;Now extract only the file name.  (And does&lt;BR /&gt;your method for that work if the file name&lt;BR /&gt;contains space characters?)&lt;BR /&gt;&lt;BR /&gt;Everything's complicated.</description>
      <pubDate>Thu, 18 Mar 2010 17:04:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230897#M51925</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-03-18T17:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: find command: How to find the oldest file in a folder</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230898#M51926</link>
      <description>Hi Den:&lt;BR /&gt;&lt;BR /&gt;Since this is the Linux forum, I'm going to assume that you are using the GNU 'find'.  Hence, "only with a method based on the find command" you could do:&lt;BR /&gt;&lt;BR /&gt;# find /path -type f -printf "%T@ %h/%f\n"|sort -k1n,1|awk 'NR==1 {print $NF}'&lt;BR /&gt;&lt;BR /&gt;The name of the oldest file in '/path' will be returned with its full path and name.&lt;BR /&gt;&lt;BR /&gt;Of course, I took the liberty of using 'sort' and 'awk' in a pipeline too :-)&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Mar 2010 20:15:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230898#M51926</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-03-18T20:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: find command: How to find the oldest file in a folder</title>
      <link>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230899#M51927</link>
      <description>Many possibilities are efficient here. &lt;BR /&gt;Thanks guys</description>
      <pubDate>Fri, 26 Mar 2010 16:25:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/find-command-how-to-find-the-oldest-file-in-a-folder/m-p/5230899#M51927</guid>
      <dc:creator>Leo The Cat</dc:creator>
      <dc:date>2010-03-26T16:25:27Z</dc:date>
    </item>
  </channel>
</rss>

