<?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: &amp;quot;non recursive find&amp;quot; or &amp;quot;how to get the age of a file&amp;quot; in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012624#M128945</link>
    <description>Thanks that works for me R.</description>
    <pubDate>Thu, 24 Dec 2009 02:37:09 GMT</pubDate>
    <dc:creator>rexy</dc:creator>
    <dc:date>2009-12-24T02:37:09Z</dc:date>
    <item>
      <title>"non recursive find" or "how to get the age of a file"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012615#M128936</link>
      <description>Hi people!&lt;BR /&gt;&lt;BR /&gt;Does anyone knows how to convince a find command not to descend the filesystem hierarchy and search only the current directory?&lt;BR /&gt;&lt;BR /&gt;The reason for that are: I need to remove a certain file just if it's more than 7 days old. The problem is that it sits on top of a very large directory structure and I can't afford to wait the find traverse the whole place before finally look around and see the file. :)&lt;BR /&gt;&lt;BR /&gt;Thanks already!&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Jul 2003 19:34:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012615#M128936</guid>
      <dc:creator>Alexandre W. Agostini</dc:creator>
      <dc:date>2003-07-01T19:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: "non recursive find" or "how to get the age of a file"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012616#M128937</link>
      <description>cd to that directory then &lt;BR /&gt;&lt;BR /&gt;find . -name "yourfile" &lt;BR /&gt;&lt;BR /&gt;or &lt;BR /&gt;&lt;BR /&gt;find /yourdir -name "your file" &lt;BR /&gt;&lt;BR /&gt;-USA..</description>
      <pubDate>Tue, 01 Jul 2003 19:40:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012616#M128937</guid>
      <dc:creator>Uday_S_Ankolekar</dc:creator>
      <dc:date>2003-07-01T19:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: "non recursive find" or "how to get the age of a file"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012617#M128938</link>
      <description>find . -maxdepth 0 &lt;BR /&gt;will operate only on the current directory.</description>
      <pubDate>Tue, 01 Jul 2003 19:46:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012617#M128938</guid>
      <dc:creator>Elena Leontieva</dc:creator>
      <dc:date>2003-07-01T19:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: "non recursive find" or "how to get the age of a file"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012618#M128939</link>
      <description>Try-&lt;BR /&gt;&lt;BR /&gt;find . -path "./*" -prune -mtime +7 -print&lt;BR /&gt;&lt;BR /&gt;The "-path" can limit the file path and "-prune" will prevent find from descending subfolders.&lt;BR /&gt;&lt;BR /&gt;If you wanted to do one level down of directories-&lt;BR /&gt;&lt;BR /&gt;find . -path "./*/*" -prune -mtime +7 -print&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 01 Jul 2003 19:46:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012618#M128939</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-07-01T19:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: "non recursive find" or "how to get the age of a file"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012619#M128940</link>
      <description>&lt;BR /&gt;That was my first attempt, but when the directory where I am have several others sub-directories each one having a lot of files the find will search those sub-directories also and the search takes much more time. How could I tell find to skip all sub-directories and search just the current one?</description>
      <pubDate>Tue, 01 Jul 2003 19:49:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012619#M128940</guid>
      <dc:creator>Alexandre W. Agostini</dc:creator>
      <dc:date>2003-07-01T19:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: "non recursive find" or "how to get the age of a file"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012620#M128941</link>
      <description>That's what "prune" does. It prunes the branches of the tree.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 01 Jul 2003 19:51:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012620#M128941</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-07-01T19:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: "non recursive find" or "how to get the age of a file"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012621#M128942</link>
      <description>&lt;BR /&gt;Bingo!&lt;BR /&gt;&lt;BR /&gt;That's perfect!&lt;BR /&gt;&lt;BR /&gt;I was really messing up with the -prune syntax.&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Tue, 01 Jul 2003 19:54:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012621#M128942</guid>
      <dc:creator>Alexandre W. Agostini</dc:creator>
      <dc:date>2003-07-01T19:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: "non recursive find" or "how to get the age of a file"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012622#M128943</link>
      <description>Regarding "...remove a certain file just if it's more than 7 days old..."&lt;BR /&gt;&lt;BR /&gt;I believe find uses a zero based counter where 0 = 24 hours.  So for seven days use 6.&lt;BR /&gt;&lt;BR /&gt;-ctime +6&lt;BR /&gt;&lt;BR /&gt;GNU find is superior and uses 'maxdepth'.&lt;BR /&gt;&lt;BR /&gt;find /dir/sub_dir -maxdepth 0 -ctime +6 -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;-atime - read or view but don't write to. (* access *)&lt;BR /&gt;-mtime - write to. (* modify *)&lt;BR /&gt;-command line level only&lt;BR /&gt;&lt;BR /&gt;So toy around with atime and ctime.&lt;BR /&gt;&lt;BR /&gt;Here's GNU find:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.cs.utah.edu/hppd/hpux/Gnu/findutils-4.1.5/" target="_blank"&gt;http://hpux.cs.utah.edu/hppd/hpux/Gnu/findutils-4.1.5/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Jul 2003 20:31:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012622#M128943</guid>
      <dc:creator>Michael Steele_2</dc:creator>
      <dc:date>2003-07-01T20:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: "non recursive find" or "how to get the age of a file"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012623#M128944</link>
      <description>by combining ls &amp;amp; find you can run:&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;for i in `ls *fname*`&lt;BR /&gt;do&lt;BR /&gt;if [ -f $i ]&lt;BR /&gt;then&lt;BR /&gt;find $i -atime +7&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jul 2003 04:59:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012623#M128944</guid>
      <dc:creator>rachel_11</dc:creator>
      <dc:date>2003-07-02T04:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: "non recursive find" or "how to get the age of a file"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012624#M128945</link>
      <description>Thanks that works for me R.</description>
      <pubDate>Thu, 24 Dec 2009 02:37:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/quot-non-recursive-find-quot-or-quot-how-to-get-the-age-of-a/m-p/3012624#M128945</guid>
      <dc:creator>rexy</dc:creator>
      <dc:date>2009-12-24T02:37:09Z</dc:date>
    </item>
  </channel>
</rss>

