<?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 in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/4039872#M302736</link>
    <description>&lt;!--!*#--&gt;As noted by JRF it is better to use "-path" instead of "-prune" which chops off everything below that directory. Try the find(1) command below:&lt;BR /&gt;&lt;BR /&gt;find / -user &lt;OLDUSR&gt; ! \( -path "/.snapshot" -o "/amd_mnt" -type d \) -a \&lt;BR /&gt;                \( -path "/.snapshot/*" -o -path "/amd_mnt/*" -type f \) | &lt;BR /&gt;                xargs -n1 chown &lt;NEWUSR&gt;&lt;/NEWUSR&gt;&lt;/OLDUSR&gt;</description>
    <pubDate>Wed, 18 Jul 2007 19:52:48 GMT</pubDate>
    <dc:creator>Sandman!</dc:creator>
    <dc:date>2007-07-18T19:52:48Z</dc:date>
    <item>
      <title>find</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/4039869#M302733</link>
      <description>Hello i have to find out a files and directories that are owned by user"x" and change the ownership to user "y" . But i have to skip the directory .snapshot and automount direcotory .But it did not skip those directories .What is wrong.pls help.tahnks&lt;BR /&gt;i have  used the below command &lt;BR /&gt;find / -user &lt;OLD username=""&gt; -prune -name .snapshot,amd_mnt -o -print  -exec chown &lt;NEW username=""&gt; {} \;&lt;/NEW&gt;&lt;/OLD&gt;</description>
      <pubDate>Wed, 18 Jul 2007 16:52:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/4039869#M302733</guid>
      <dc:creator>navin</dc:creator>
      <dc:date>2007-07-18T16:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: find</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/4039870#M302734</link>
      <description>I would run something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;find / ! -name .snapshot ! -name amd_mnt -user olduser -exec chown &lt;NEWUSER&gt; {} \;&lt;/NEWUSER&gt;</description>
      <pubDate>Wed, 18 Jul 2007 18:03:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/4039870#M302734</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2007-07-18T18:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: find</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/4039871#M302735</link>
      <description>Hi Navin:&lt;BR /&gt;&lt;BR /&gt;I prefer adding negated '-path' as:&lt;BR /&gt;&lt;BR /&gt;# find / -user &lt;OLD username=""&gt; -path "/snapshot*" -a ! -path "/amd_mnt/*" -exec chown &lt;NEW username=""&gt; {} \+&lt;BR /&gt;&lt;BR /&gt;Note that on 11.0 and later, the use of the '+' terminator improves performance by bundling multiple arguments to the object of the '-exec' much like 'xargs' would do.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...  &lt;BR /&gt; &lt;BR /&gt;  &lt;BR /&gt;  &lt;BR /&gt; &lt;BR /&gt;&lt;/NEW&gt;&lt;/OLD&gt;</description>
      <pubDate>Wed, 18 Jul 2007 18:09:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/4039871#M302735</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-07-18T18:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: find</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/4039872#M302736</link>
      <description>&lt;!--!*#--&gt;As noted by JRF it is better to use "-path" instead of "-prune" which chops off everything below that directory. Try the find(1) command below:&lt;BR /&gt;&lt;BR /&gt;find / -user &lt;OLDUSR&gt; ! \( -path "/.snapshot" -o "/amd_mnt" -type d \) -a \&lt;BR /&gt;                \( -path "/.snapshot/*" -o -path "/amd_mnt/*" -type f \) | &lt;BR /&gt;                xargs -n1 chown &lt;NEWUSR&gt;&lt;/NEWUSR&gt;&lt;/OLDUSR&gt;</description>
      <pubDate>Wed, 18 Jul 2007 19:52:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/4039872#M302736</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-07-18T19:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: find</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/4039873#M302737</link>
      <description>&amp;gt;Sandman: Try the find(1) command below:&lt;BR /&gt;&lt;BR /&gt;You have operator precedence issues with your command.  -a has higher percedence than -o, so you need extra \( \).  And you should use -exec {} +&lt;BR /&gt;&lt;BR /&gt;I'm not sure why you have that second check for file versions of those two paths?&lt;BR /&gt;Was that "\" a "!"?&lt;BR /&gt;If so, you probably want an extra "*" before&lt;BR /&gt;/.snapshot/*.  Since I believe there are lots of those directories, at every level.&lt;BR /&gt;&lt;BR /&gt;find / -user &lt;OLDUSR&gt; ! \( \( -path "/.snapshot" -o "/amd_mnt" \) -type d \) -a&lt;BR /&gt;    !  \( \( -path "/.snapshot/*" -o -path "/amd_mnt/*" \) -type f \) -exec chown &lt;NEWUSR&gt; {} \+&lt;/NEWUSR&gt;&lt;/OLDUSR&gt;</description>
      <pubDate>Thu, 19 Jul 2007 04:54:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/4039873#M302737</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-07-19T04:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: find</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/4039874#M302738</link>
      <description>&lt;!--!*#--&gt;&amp;gt;Dennis&lt;BR /&gt;&lt;BR /&gt;Glad you noticed the find(1) I posted as it frankly does not make much sense. Moreover the catchall {} + operator is more efficient over pipelining it to xargs(1). Guess that what happens when postings are untested :( and so here is the tested version of the find(1) posted earlier and hope it helps :)&lt;BR /&gt;&lt;BR /&gt;find / -user &lt;OLDUSR&gt; \&lt;BR /&gt;    ! \( -path "/.snapshot" -o \&lt;BR /&gt;         -path "/.snapshot/*" -o \&lt;BR /&gt;         -path "/amd_mnt" -o \&lt;BR /&gt;         -path "/amd_mnt/*" \) \&lt;BR /&gt;         -exec chown &lt;NEWUSR&gt; {} +&lt;/NEWUSR&gt;&lt;/OLDUSR&gt;</description>
      <pubDate>Thu, 19 Jul 2007 09:34:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/4039874#M302738</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-07-19T09:34:30Z</dc:date>
    </item>
  </channel>
</rss>

