<?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 Find in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920980#M764441</link>
    <description>&lt;BR /&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;Find a particular file a unknown path . this I can do using &lt;BR /&gt;&lt;BR /&gt;Find / -name “name of the file”&lt;BR /&gt;&lt;BR /&gt;Also I would like to find a particular string in that specified files.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 04 Jan 2007 13:12:32 GMT</pubDate>
    <dc:creator>johnreid</dc:creator>
    <dc:date>2007-01-04T13:12:32Z</dc:date>
    <item>
      <title>Find</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920980#M764441</link>
      <description>&lt;BR /&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;Find a particular file a unknown path . this I can do using &lt;BR /&gt;&lt;BR /&gt;Find / -name “name of the file”&lt;BR /&gt;&lt;BR /&gt;Also I would like to find a particular string in that specified files.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 04 Jan 2007 13:12:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920980#M764441</guid>
      <dc:creator>johnreid</dc:creator>
      <dc:date>2007-01-04T13:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Find</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920981#M764442</link>
      <description>find / -exec grep -l "string" {} \;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 04 Jan 2007 13:16:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920981#M764442</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2007-01-04T13:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: Find</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920982#M764443</link>
      <description>find / -type f | xargs grep -il "string"</description>
      <pubDate>Thu, 04 Jan 2007 13:27:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920982#M764443</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2007-01-04T13:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Find</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920983#M764444</link>
      <description>Johnreid,&lt;BR /&gt;&lt;BR /&gt;Also remember this will take considerably longtime if you are using from root (/),&lt;BR /&gt;&lt;BR /&gt;Also you can use :&lt;BR /&gt;&lt;BR /&gt;# ls -lR | awk '{print $9}' | xargs grep -l "expr"&lt;BR /&gt;&lt;BR /&gt;This will give you the file names with the matching string,&lt;BR /&gt;                                                                                                                 &lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.</description>
      <pubDate>Thu, 04 Jan 2007 17:21:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920983#M764444</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2007-01-04T17:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Find</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920984#M764445</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;In the above example, "expr" is the 'string' that you are looking for in all the files recursively.&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.</description>
      <pubDate>Thu, 04 Jan 2007 17:24:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920984#M764445</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2007-01-04T17:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Find</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920985#M764446</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;If you are searching for files in the root ('/') directory, you would be advised to add '-xdev' so that you do not cross mountpoints.&lt;BR /&gt;&lt;BR /&gt;Secondly, either pipe 'find's output to 'xargs' or terminate the '-exec' argument with a plus sign ('+') rather than a semicolon (';').  Using 'xargs' or using a plus sign character greatly improves performance because multiple arguments are processes instead of spawning a new process for every, single argument.&lt;BR /&gt;&lt;BR /&gt;Thus:&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -name "*my*" -exec grep pattern {} /dev/null \+&lt;BR /&gt;&lt;BR /&gt;Prior to 11i, you use a '\;' instead of '\+' to terminate the 'find' and suffer the performance penality.&lt;BR /&gt;&lt;BR /&gt;Otherwise:&lt;BR /&gt;&lt;BR /&gt;# find / -xdev -type f -name "*my*" | xargs grep pattern&lt;BR /&gt;&lt;BR /&gt;Note the addition of the '/dev/null' to the form using '-exec' causes the matching filename to be printed for positive 'grep's.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 04 Jan 2007 17:55:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920985#M764446</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-01-04T17:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Find</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920986#M764447</link>
      <description>Hi,&lt;BR /&gt;to search string "hello world" only in text files including subdirectories:&lt;BR /&gt;&lt;BR /&gt;grep "hello world" $(find ./ -type f |xargs file|grep text|cut -d ':' -f1) &lt;BR /&gt;&lt;BR /&gt;./             = start directory &lt;BR /&gt;-type f        = only files&lt;BR /&gt;grep text      = only text files&lt;BR /&gt;cut -d ':' -f1 = name of the file&lt;BR /&gt;&lt;BR /&gt;this will avoid to look into other files than text i.e.: binary, links and so on.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Jan 2007 04:16:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/find/m-p/3920986#M764447</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2007-01-05T04:16:30Z</dc:date>
    </item>
  </channel>
</rss>

