<?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 problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569696#M227976</link>
    <description>Hi Hurd&lt;BR /&gt;&lt;BR /&gt;To find files that were created in the last few&lt;BR /&gt;minutes.  The time given is just a example on how the command will work.&lt;BR /&gt;&lt;BR /&gt;     #touch -t 0304290900 test&lt;BR /&gt;&lt;BR /&gt;This will create a file with time stamp of 4/29/2003 and time of 9:00 AM.&lt;BR /&gt;&lt;BR /&gt;     #find /home -newer test&lt;BR /&gt;&lt;BR /&gt;This will search /home for files that have a newer time stamp of 9:00 AM.&lt;BR /&gt;For example, if user /home/bob touched/edited a file at 9:01 AM on 4/29/03,&lt;BR /&gt;then the output would return the file that Bob modified.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Vinod K</description>
    <pubDate>Thu, 23 Jun 2005 18:59:40 GMT</pubDate>
    <dc:creator>vinod_25</dc:creator>
    <dc:date>2005-06-23T18:59:40Z</dc:date>
    <item>
      <title>Find command problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569687#M227967</link>
      <description>I am trying to use the find command to look for files less than x minutes old.  Problem is, most of these HP and Sun machines here have an older find command that only has switches that go by day, not minutes.&lt;BR /&gt;&lt;BR /&gt;Is there any way I can use this old find command to find files less than x minutes old or is there another command that may do this directly or indirectly?&lt;BR /&gt;&lt;BR /&gt;Thanks, Jayson</description>
      <pubDate>Thu, 23 Jun 2005 13:12:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569687#M227967</guid>
      <dc:creator>Jayson B. Hurd</dc:creator>
      <dc:date>2005-06-23T13:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Find command problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569688#M227968</link>
      <description>Jayson,&lt;BR /&gt;&lt;BR /&gt;Your only hope is to use -newer .  Touch a file with the time you need to check and then run find with either -newer or ! -newer as the case may be.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 23 Jun 2005 13:18:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569688#M227968</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2005-06-23T13:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Find command problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569689#M227969</link>
      <description>if the files you are looking for, are in the same directory, this hack may work&lt;BR /&gt;&lt;BR /&gt;touch markerfile -t MMDDhhmm&lt;BR /&gt;ls -rt &amp;gt; /tmp/tempfile&lt;BR /&gt;markerloc=`grep -n markerfile /tmp/tempfile | cut -d: -f1`&lt;BR /&gt;sed -e "1,${markerloc}d" /tmp/tempfile &amp;gt; /tmp/filelist&lt;BR /&gt;&lt;BR /&gt;this procedure has gaping holes in it as it does not check against any errors but can give you a good idea how to tackle the problem.&lt;BR /&gt;&lt;BR /&gt;hope it helps&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jun 2005 13:21:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569689#M227969</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2005-06-23T13:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: Find command problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569690#M227970</link>
      <description>You can get the GNU version of find which has a "-mmin" option that will search for all files that are less than specified minutes old. e.g.&lt;BR /&gt;&lt;BR /&gt;# find &lt;START_DIR&gt; -mmin x&lt;BR /&gt;&lt;BR /&gt;this will search all files that are less than x minutes old.&lt;/START_DIR&gt;</description>
      <pubDate>Thu, 23 Jun 2005 13:54:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569690#M227970</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-06-23T13:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Find command problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569691#M227971</link>
      <description>find . -depth -exec ll {} \; &amp;gt; outputfile&lt;BR /&gt;&lt;BR /&gt;Then you can manipulate outputfile with grep (i.e. grep "Jun 24" outputfile ) to narrow it down a bit.&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jun 2005 13:54:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569691#M227971</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2005-06-23T13:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Find command problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569692#M227972</link>
      <description>Thanks for the input.  I'm starting to get there.  I've managed to get files less than one day old to narrow it down...  Question is, how would I then use the time piece of it and then evaluate current time against that time?  So for example I now have a list of files, but I want to see if any of the files listed are less than a certain amount of minutes old....  &lt;BR /&gt;&lt;BR /&gt;Man this would be so easy if my 'find' command were new enough to use the -mmin command...&lt;BR /&gt;&lt;BR /&gt;Any ideas?</description>
      <pubDate>Thu, 23 Jun 2005 14:49:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569692#M227972</guid>
      <dc:creator>Jayson B. Hurd</dc:creator>
      <dc:date>2005-06-23T14:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Find command problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569693#M227973</link>
      <description>Go back and look at Pete's response.&lt;BR /&gt;&lt;BR /&gt;Say you want to find files with a time stamp after 1:30PM today&lt;BR /&gt;&lt;BR /&gt;# touch -t 06231330 afile&lt;BR /&gt;&lt;BR /&gt;(man touch for more info.)&lt;BR /&gt;&lt;BR /&gt;# find /dir -newer afile&lt;BR /&gt;&lt;BR /&gt;That will find files that are newer than the file afile.</description>
      <pubDate>Thu, 23 Jun 2005 15:35:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569693#M227973</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-06-23T15:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Find command problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569694#M227974</link>
      <description>OK I'm on that - however I need it to be dynamic.  I need it to touch a file that is xx minutes older than the time when the script runs...</description>
      <pubDate>Thu, 23 Jun 2005 15:44:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569694#M227974</guid>
      <dc:creator>Jayson B. Hurd</dc:creator>
      <dc:date>2005-06-23T15:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find command problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569695#M227975</link>
      <description>Sometimes it's hard to beat Perl. I would use Perl's File::Find for the whole thing but here's something that will create a touch timestamp spec for you - a string in the format CCYYMMDDhhmm.ss that can be -p seconds before or -n seconds after now.&lt;BR /&gt;&lt;BR /&gt;Use it like this:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset TMSPEC=''&lt;BR /&gt;typeset TDIR=${TMPDIR:-/var/tmp}&lt;BR /&gt;typeset REFFILE=${TDIR}/X${$}_1.ref&lt;BR /&gt;&lt;BR /&gt;TMSPEC=$(timestamp.pl -p 300) # 300 seconds before now&lt;BR /&gt;touch -m -t ${TMSPEC} ${REFFILE}&lt;BR /&gt;&lt;BR /&gt;# your find stuff goes here&lt;BR /&gt;&lt;BR /&gt;rm -f ${REFFILE} # clean up after yourself&lt;BR /&gt;&lt;BR /&gt;Here's the Perl attachment, timestamp.pl;&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jun 2005 16:21:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569695#M227975</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-06-23T16:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Find command problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569696#M227976</link>
      <description>Hi Hurd&lt;BR /&gt;&lt;BR /&gt;To find files that were created in the last few&lt;BR /&gt;minutes.  The time given is just a example on how the command will work.&lt;BR /&gt;&lt;BR /&gt;     #touch -t 0304290900 test&lt;BR /&gt;&lt;BR /&gt;This will create a file with time stamp of 4/29/2003 and time of 9:00 AM.&lt;BR /&gt;&lt;BR /&gt;     #find /home -newer test&lt;BR /&gt;&lt;BR /&gt;This will search /home for files that have a newer time stamp of 9:00 AM.&lt;BR /&gt;For example, if user /home/bob touched/edited a file at 9:01 AM on 4/29/03,&lt;BR /&gt;then the output would return the file that Bob modified.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Vinod K</description>
      <pubDate>Thu, 23 Jun 2005 18:59:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569696#M227976</guid>
      <dc:creator>vinod_25</dc:creator>
      <dc:date>2005-06-23T18:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Find command problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569697#M227977</link>
      <description>Hi Jayson,&lt;BR /&gt;&lt;BR /&gt;I have a logic, if you are good in scripting&lt;BR /&gt;&lt;BR /&gt;1. Get a list of files modified in a day by find command and store in todaysfiles&lt;BR /&gt;&lt;BR /&gt;2. Grep list of files modified on hour basis&lt;BR /&gt;e.g. grep "Jun 22 22:" todaysfiles &lt;BR /&gt;will give you files modified between 22:00 to 22:59.&lt;BR /&gt;&lt;BR /&gt;if you still want to fine tune, you can use awk command compare hour first and then compare time with separate variables.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers!!!&lt;BR /&gt;eknath&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Jun 2005 20:42:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569697#M227977</guid>
      <dc:creator>Eknath</dc:creator>
      <dc:date>2005-06-23T20:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Find command problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569698#M227978</link>
      <description>The perl script was the answer in combination with the -newer parameter on the find command.  It appears that only the new gnu find version does -cmin (minutes) thereby necessitating the workaround.&lt;BR /&gt;&lt;BR /&gt;Thanks to all!</description>
      <pubDate>Fri, 24 Jun 2005 10:55:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find-command-problem/m-p/3569698#M227978</guid>
      <dc:creator>Jayson B. Hurd</dc:creator>
      <dc:date>2005-06-24T10:55:13Z</dc:date>
    </item>
  </channel>
</rss>

