<?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: Interrogate file owner in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961266#M415744</link>
    <description>To make sure you don't list a directories contents you could also add a '-d' to your 'll':&lt;BR /&gt;&lt;BR /&gt;# find . ! -user mickey -mtime +30 -type f -exec ll -d {} ;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 21 Feb 2006 12:02:31 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2006-02-21T12:02:31Z</dc:date>
    <item>
      <title>Interrogate file owner</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961257#M415735</link>
      <description>Trying to find a script to delete files that are older than &lt;DATE&gt; AND that are not owned by a certain user.&lt;BR /&gt;&lt;BR /&gt;Syntax used:&lt;BR /&gt;  find . -depth -mtime +&lt;NUM of="" days=""&gt;&lt;BR /&gt;            -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;This script works great to remove files that are certain days old, but I need to add to it to Not remove the file if it is owned by a paticular user.  Any ideas on how to do this?&lt;BR /&gt;&lt;BR /&gt;Monte &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;/NUM&gt;&lt;/DATE&gt;</description>
      <pubDate>Mon, 20 Feb 2006 17:18:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961257#M415735</guid>
      <dc:creator>Monte Heeren</dc:creator>
      <dc:date>2006-02-20T17:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Interrogate file owner</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961258#M415736</link>
      <description>Add ! -user username&lt;BR /&gt;&lt;BR /&gt;! negates whatever test you put it in front of.</description>
      <pubDate>Mon, 20 Feb 2006 17:27:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961258#M415736</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2006-02-20T17:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Interrogate file owner</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961259#M415737</link>
      <description>find . -depth -mtime +30 ! -user mickey -exec rm {} \;&lt;BR /&gt;&lt;BR /&gt;will delete all files that have not been modified in the last 30 days and not owned by user "mickey".&lt;BR /&gt;&lt;BR /&gt;When developing any finds like this, it is always better to -exec a safe command like "ls -l" until you are certain that your filters are just right and then switch to the real "rm" command.&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Feb 2006 17:34:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961259#M415737</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-02-20T17:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Interrogate file owner</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961260#M415738</link>
      <description>Thank you Jeff Traigle and A. Stephenson.&lt;BR /&gt;That was exactly the answer I was looking for.  This forum is priceless!&lt;BR /&gt;&lt;BR /&gt;Monte Heeren&lt;BR /&gt;DBA/Systems Engineer&lt;BR /&gt;Area Education Agency 11&lt;BR /&gt;Johnston IA 50131</description>
      <pubDate>Tue, 21 Feb 2006 09:20:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961260#M415738</guid>
      <dc:creator>Monte Heeren</dc:creator>
      <dc:date>2006-02-21T09:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Interrogate file owner</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961261#M415739</link>
      <description>Can not get the ! operator to work.&lt;BR /&gt;&lt;BR /&gt;If I enter:&lt;BR /&gt;find . -user mickey -exec ll {} \;&lt;BR /&gt;  it will return with only files that are&lt;BR /&gt;  owned by mickey.  This works great.&lt;BR /&gt;&lt;BR /&gt;But if I enter:&lt;BR /&gt;find . ! -user mickey -exec ll {} \;&lt;BR /&gt;  it returns with all the files in the dir,&lt;BR /&gt;  including the files owned by mickey.&lt;BR /&gt; &lt;BR /&gt;Look like the ! operator is not working.&lt;BR /&gt;Is there another "NOT" character to use?&lt;BR /&gt;&lt;BR /&gt;Monte.</description>
      <pubDate>Tue, 21 Feb 2006 11:48:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961261#M415739</guid>
      <dc:creator>Monte Heeren</dc:creator>
      <dc:date>2006-02-21T11:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: Interrogate file owner</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961262#M415740</link>
      <description>&lt;BR /&gt;Are you using "csh"? If so, the ! character means something else.  Try putting a backslash "\" in front of it.</description>
      <pubDate>Tue, 21 Feb 2006 11:56:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961262#M415740</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2006-02-21T11:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Interrogate file owner</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961263#M415741</link>
      <description>I suspect that you are ll'ing directories. In that case, eventhough the directory is properly filtered all files under that directory are listed. What you should do is add a '-type f' filter so that only regular files are found. &lt;BR /&gt;&lt;BR /&gt;You didn't bother to indicate your HP-UX version but I would also make sure that the latest find cumulative patch is installed. For 11.11, it's PHCO_30746.</description>
      <pubDate>Tue, 21 Feb 2006 11:58:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961263#M415741</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2006-02-21T11:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Interrogate file owner</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961264#M415742</link>
      <description>Hi Monte,&lt;BR /&gt;&lt;BR /&gt;You need to make it boolean.&lt;BR /&gt;Surround the two operators with (  ) - separate them with spaces from the operands AND use -a for the AND operator.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 21 Feb 2006 12:00:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961264#M415742</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2006-02-21T12:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: Interrogate file owner</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961265#M415743</link>
      <description>oh, I see, it's returning "." in the set, and this will automatically list everything in any subdirectory which matches the return set.  In other words, since "." is returned, everything under "." is listed also.&lt;BR /&gt;&lt;BR /&gt;Try adding "-type f" to the command:&lt;BR /&gt;&lt;BR /&gt;find . ! -user mickey -mtime +30 -type f&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Feb 2006 12:01:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961265#M415743</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2006-02-21T12:01:32Z</dc:date>
    </item>
    <item>
      <title>Re: Interrogate file owner</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961266#M415744</link>
      <description>To make sure you don't list a directories contents you could also add a '-d' to your 'll':&lt;BR /&gt;&lt;BR /&gt;# find . ! -user mickey -mtime +30 -type f -exec ll -d {} ;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Feb 2006 12:02:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961266#M415744</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2006-02-21T12:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Interrogate file owner</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961267#M415745</link>
      <description>Hi Monte,&lt;BR /&gt;&lt;BR /&gt;You need to make it boolean.&lt;BR /&gt;Surround the two operators with (  ) - separate them with spaces from the operands AND use -a for the AND operator.&lt;BR /&gt;And they need to be escaped with leading  \&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Jeff</description>
      <pubDate>Tue, 21 Feb 2006 12:02:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961267#M415745</guid>
      <dc:creator>Jeff Schussele</dc:creator>
      <dc:date>2006-02-21T12:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Interrogate file owner</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961268#M415746</link>
      <description>Thank you all for your quick response. &lt;BR /&gt;This is the only place for Unix help!&lt;BR /&gt;&lt;BR /&gt;I added the -type f to the end of the command and it works perfectly.&lt;BR /&gt;&lt;BR /&gt;Monte Heeren.</description>
      <pubDate>Tue, 21 Feb 2006 12:16:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961268#M415746</guid>
      <dc:creator>Monte Heeren</dc:creator>
      <dc:date>2006-02-21T12:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Interrogate file owner</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961269#M415747</link>
      <description>Thank you for your quick response.&lt;BR /&gt;&lt;BR /&gt;I have found the answer and am closing this thread.&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Feb 2006 12:20:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/interrogate-file-owner/m-p/4961269#M415747</guid>
      <dc:creator>Monte Heeren</dc:creator>
      <dc:date>2006-02-21T12:20:46Z</dc:date>
    </item>
  </channel>
</rss>

