<?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: How to do this find command? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992546#M124689</link>
    <description>Angie:&lt;BR /&gt;&lt;BR /&gt;I used Pete's answer as an example, Paul and John's will work too. I did not want to leave them behind.  &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;DR&lt;BR /&gt;&lt;BR /&gt;NO POINTS PLEASE</description>
    <pubDate>Mon, 09 Jun 2003 20:45:43 GMT</pubDate>
    <dc:creator>Dario_1</dc:creator>
    <dc:date>2003-06-09T20:45:43Z</dc:date>
    <item>
      <title>How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992528#M124671</link>
      <description>I need a find command that will do the following:&lt;BR /&gt;&lt;BR /&gt;-I want it to /test/aoi/inspire/defects/812165000/E02 and look for any directories under here that are more than 30 days old and if it finds them, prompts for a delete.&lt;BR /&gt;&lt;BR /&gt;I can do it for files, not for directories.&lt;BR /&gt;&lt;BR /&gt;Please help soon, I need it today.&lt;BR /&gt;&lt;BR /&gt;Thx..Angie</description>
      <pubDate>Mon, 09 Jun 2003 16:41:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992528#M124671</guid>
      <dc:creator>Angie_1</dc:creator>
      <dc:date>2003-06-09T16:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992529#M124672</link>
      <description>I noticed I needed to clarify more.&lt;BR /&gt;&lt;BR /&gt;There are many many 812* directories.  So I need to be able to go down into the E02 and E03..E04.. E05..E06 directory, check under each of those and find if there is a directory more than 30 days old.  If it then finds it, prompt for delete.&lt;BR /&gt;&lt;BR /&gt;So I need to go through lots of 812* directories and lower to do the check.&lt;BR /&gt;&lt;BR /&gt;Thx..Angie</description>
      <pubDate>Mon, 09 Jun 2003 16:43:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992529#M124672</guid>
      <dc:creator>Angie_1</dc:creator>
      <dc:date>2003-06-09T16:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992530#M124673</link>
      <description>Hi Angie,&lt;BR /&gt;&lt;BR /&gt;Have you tried something like this:&lt;BR /&gt;&lt;BR /&gt;find /test/aoi/inspire/defects/ -type d -name '812*' -exec 'rm -i' {} \;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Mon, 09 Jun 2003 16:47:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992530#M124673</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-06-09T16:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992531#M124674</link>
      <description>find test/aoi/inspire/defects/812165000/E02 -type d -ctime 30 |xargs rm</description>
      <pubDate>Mon, 09 Jun 2003 16:47:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992531#M124674</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2003-06-09T16:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992532#M124675</link>
      <description>Hi Angie,&lt;BR /&gt;&lt;BR /&gt;Here is one way to try it:&lt;BR /&gt;&lt;BR /&gt;find /test/aoi/inspire/defects/812* -type d -mtime +30 -depth -ok rm -rf {} \;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I would suggest testing it first by replacing the 'rm -rf' with something like an 'ls -ld' to make sure it is returning the correct directories.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Jun 2003 16:50:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992532#M124675</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2003-06-09T16:50:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992533#M124676</link>
      <description>Hey thanks both for replying!&lt;BR /&gt;&lt;BR /&gt;So would either of those find commands go underneath the 812* part, then go underneath each of the directories under there?  Example, 812165000 may have E01, E02, E03...E20 and I would need to do the actual check on each directory under each E01, E02, E03... etc.&lt;BR /&gt;&lt;BR /&gt;Please respond.&lt;BR /&gt;Angie</description>
      <pubDate>Mon, 09 Jun 2003 16:50:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992533#M124676</guid>
      <dc:creator>Angie_1</dc:creator>
      <dc:date>2003-06-09T16:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992534#M124677</link>
      <description>Angie,&lt;BR /&gt;&lt;BR /&gt;Sorry, I left out the mtime part!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Mon, 09 Jun 2003 16:53:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992534#M124677</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-06-09T16:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992535#M124678</link>
      <description>Thats ok!  I appreciate all the help!  I need to figure out which one to try now..thx!&lt;BR /&gt;&lt;BR /&gt;Angie</description>
      <pubDate>Mon, 09 Jun 2003 16:54:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992535#M124678</guid>
      <dc:creator>Angie_1</dc:creator>
      <dc:date>2003-06-09T16:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992536#M124679</link>
      <description>Angie,&lt;BR /&gt;&lt;BR /&gt;One thing to consider is that removing a file from a directory will change the modified date of the directory, so the counter will reset.  You might want to run the find without trying to remove the directories first, store the information in a file, and then try to remove the directories.&lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Mon, 09 Jun 2003 16:55:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992536#M124679</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2003-06-09T16:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992537#M124680</link>
      <description>The find should go underneath the 812* part</description>
      <pubDate>Mon, 09 Jun 2003 16:55:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992537#M124680</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2003-06-09T16:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992538#M124681</link>
      <description>Yes, the find command will check all directories and it's subs:&lt;BR /&gt;&lt;BR /&gt;# find dir_path -type d -depth -xdev \( -atime +30 -a -mtime +30 \) -exec rm -ir {} \;&lt;BR /&gt;&lt;BR /&gt;This will check each directories and will prompt for delete if not accessed or modified within last 30 days.</description>
      <pubDate>Mon, 09 Jun 2003 16:56:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992538#M124681</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2003-06-09T16:56:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992539#M124682</link>
      <description>Hi Shiju,&lt;BR /&gt;&lt;BR /&gt;'find' on a directory will change it's "atime" immediately, so I guess the command you gave won't yield any result.&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;Gary</description>
      <pubDate>Mon, 09 Jun 2003 18:31:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992539#M124682</guid>
      <dc:creator>Gary Yu</dc:creator>
      <dc:date>2003-06-09T18:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992540#M124683</link>
      <description>Why isn't this command working as it looks to me it should (I am trying to use this one as I understand it better than the other suggestions):&lt;BR /&gt;&lt;BR /&gt;find /tmp/811* -type d -mtime +30 -depth -ok ls -ld {} \;</description>
      <pubDate>Mon, 09 Jun 2003 19:56:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992540#M124683</guid>
      <dc:creator>Angie_1</dc:creator>
      <dc:date>2003-06-09T19:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992541#M124684</link>
      <description>Angie,&lt;BR /&gt;&lt;BR /&gt;What error message are you getting when you try the command?  Do you have some 811* directories in /tmp?  You might have to enclose the '/tmp/811*' in single quotes.&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Jun 2003 20:12:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992541#M124684</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2003-06-09T20:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992542#M124685</link>
      <description>Not sure why your command works, unless it sees nothing over 30 days old.  If I were you, I'd take this a step further and create a cache file to work from.. I.E.&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;##########&lt;BR /&gt;CACHE=/tmp/.doIdelete&lt;BR /&gt;if [ -f "${CACHE}" ] ; then&lt;BR /&gt;  rm -f $CACHE&lt;BR /&gt;fi&lt;BR /&gt;touch $CACHE&lt;BR /&gt;find /test/aoi/inspire/defects -type d -name "812*" -atime +30 -print 1&amp;gt;&amp;gt;$CACHE 2&amp;gt;&amp;gt;/dev/null&lt;BR /&gt;&lt;BR /&gt;#  At this point, look at your file.&lt;BR /&gt;#  If it's empty, then nothing is older &lt;BR /&gt;#  than 30 days.  Change the number to &lt;BR /&gt;#  ensure that your seeing output&lt;BR /&gt;#  If you have output, add this&lt;BR /&gt;&lt;BR /&gt;for DIR in `cat ${CACHE}` ; do&lt;BR /&gt;echo "Delete $DIR?  Y/N"&lt;BR /&gt;read INPUT&lt;BR /&gt;case $INPUT in&lt;BR /&gt;   y*|Y*)  rm -fr $DIR&lt;BR /&gt;           echo "$DIR is gone"&lt;BR /&gt;;;&lt;BR /&gt;   n*|N*)  echo "Not touching it"&lt;BR /&gt;esac&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This will make a nice loop, and give you a chance to see what is going on.  While find is good by itself, most of us want to "Know" that it's working like we want.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shannon</description>
      <pubDate>Mon, 09 Jun 2003 20:17:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992542#M124685</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2003-06-09T20:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992543#M124686</link>
      <description>echo sorry, I hate this little typing box... In the case statement you need to add ";;" in the line below the "n*|N)" line.&lt;BR /&gt;&lt;BR /&gt;The whole case should be...&lt;BR /&gt;&lt;BR /&gt;case $INPUT in&lt;BR /&gt;y*|Y*) rm -fr $DIR&lt;BR /&gt;echo "$DIR is gone"&lt;BR /&gt;;;&lt;BR /&gt;n*|N*) echo "Not touching it"&lt;BR /&gt;;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Shannon</description>
      <pubDate>Mon, 09 Jun 2003 20:20:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992543#M124686</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2003-06-09T20:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992544#M124687</link>
      <description>Yes I have a directory in /tmp to test with.&lt;BR /&gt;&lt;BR /&gt;I don't understand the Case statements very well.  I was trying to avoid that and just use the find command.&lt;BR /&gt;&lt;BR /&gt;Can it be done?&lt;BR /&gt;&lt;BR /&gt;Angie</description>
      <pubDate>Mon, 09 Jun 2003 20:26:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992544#M124687</guid>
      <dc:creator>Angie_1</dc:creator>
      <dc:date>2003-06-09T20:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992545#M124688</link>
      <description>Angie&lt;BR /&gt;&lt;BR /&gt;If you are 100% sure you can delete the directory then avoid the part that prompt you for an answer. In that case, just try Pete's recommendation. Otherwise you will have to use a case statement.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;DR&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Jun 2003 20:37:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992545#M124688</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2003-06-09T20:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992546#M124689</link>
      <description>Angie:&lt;BR /&gt;&lt;BR /&gt;I used Pete's answer as an example, Paul and John's will work too. I did not want to leave them behind.  &lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;DR&lt;BR /&gt;&lt;BR /&gt;NO POINTS PLEASE</description>
      <pubDate>Mon, 09 Jun 2003 20:45:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992546#M124689</guid>
      <dc:creator>Dario_1</dc:creator>
      <dc:date>2003-06-09T20:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to do this find command?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992547#M124690</link>
      <description>The case statement is not as confusing as it looks.&lt;BR /&gt;&lt;BR /&gt;case $VARIABLE in&lt;BR /&gt;   something)   "exec this"&lt;BR /&gt;                 ;;  #ends something&lt;BR /&gt;   nextthing)  "exec this"&lt;BR /&gt;               ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;All I did was used the "read" command to get input from the user.  I used y*|Y*) so that if anything beginning with "y" or "Y" is typed in, it's accepted to delete.  Meaning someone types "yes" instead of just "y" then enter.  Yes, you can use wildcards as well as "|" piped strings to look for in the case.&lt;BR /&gt;&lt;BR /&gt;I think if you type it in just how I have it, it should work.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shannon</description>
      <pubDate>Mon, 09 Jun 2003 20:45:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-do-this-find-command/m-p/2992547#M124690</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2003-06-09T20:45:49Z</dc:date>
    </item>
  </channel>
</rss>

