<?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 search srings in OS? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895513#M282129</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;As noted, you don't want to search directories, and you don't want to search binary files.  Youc can use this approach though:&lt;BR /&gt;&lt;BR /&gt;# cat ./google&lt;BR /&gt;#/usr/bin/sh&lt;BR /&gt;typeset DIR=$1&lt;BR /&gt;typeset PAT=$2&lt;BR /&gt;find ${DIR} -type f | while read FILE&lt;BR /&gt;do&lt;BR /&gt;[ `file ${FILE}|grep -c ascii` -eq 0 ] &amp;amp;&amp;amp; continue&lt;BR /&gt;grep "$PAT" ${FILE} /dev/null&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;...run the script passing the directory ($1) that you want to search and the pattern ($2) you want to find. For example:&lt;BR /&gt;&lt;BR /&gt;./google /etc/rc.config.d ROUTE&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Thu, 09 Nov 2006 10:41:13 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2006-11-09T10:41:13Z</dc:date>
    <item>
      <title>How to search srings in OS?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895508#M282124</link>
      <description>hello all,&lt;BR /&gt;I want to find a file with strings "hello" in it.&lt;BR /&gt;how can I do?use find command?thanks</description>
      <pubDate>Thu, 09 Nov 2006 10:21:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895508#M282124</guid>
      <dc:creator>lin.chen</dc:creator>
      <dc:date>2006-11-09T10:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to search srings in OS?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895509#M282125</link>
      <description>cd /&lt;BR /&gt;find . -print | xargs grep -i hello</description>
      <pubDate>Thu, 09 Nov 2006 10:23:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895509#M282125</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2006-11-09T10:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to search srings in OS?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895510#M282126</link>
      <description>or just&lt;BR /&gt;&lt;BR /&gt;cd /dir&lt;BR /&gt;grep -i hello *</description>
      <pubDate>Thu, 09 Nov 2006 10:25:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895510#M282126</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2006-11-09T10:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to search srings in OS?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895511#M282127</link>
      <description>Shalom lin.chen,&lt;BR /&gt;&lt;BR /&gt;find / -exec grep -l "hello" {} \;&lt;BR /&gt;&lt;BR /&gt;find &lt;DIRECTORY name=""&gt; options&lt;BR /&gt;&lt;BR /&gt;SEP&lt;/DIRECTORY&gt;</description>
      <pubDate>Thu, 09 Nov 2006 10:28:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895511#M282127</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2006-11-09T10:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to search srings in OS?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895512#M282128</link>
      <description>Hi,&lt;BR /&gt;Please read:&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=629412" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=629412&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The -type f  restrict to files only, rather than for example directories etc.&lt;BR /&gt;&lt;BR /&gt;Note: This can take a while to run and return some strange results, like searching binaries etc.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Nov 2006 10:33:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895512#M282128</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-11-09T10:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to search srings in OS?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895513#M282129</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;As noted, you don't want to search directories, and you don't want to search binary files.  Youc can use this approach though:&lt;BR /&gt;&lt;BR /&gt;# cat ./google&lt;BR /&gt;#/usr/bin/sh&lt;BR /&gt;typeset DIR=$1&lt;BR /&gt;typeset PAT=$2&lt;BR /&gt;find ${DIR} -type f | while read FILE&lt;BR /&gt;do&lt;BR /&gt;[ `file ${FILE}|grep -c ascii` -eq 0 ] &amp;amp;&amp;amp; continue&lt;BR /&gt;grep "$PAT" ${FILE} /dev/null&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;...run the script passing the directory ($1) that you want to search and the pattern ($2) you want to find. For example:&lt;BR /&gt;&lt;BR /&gt;./google /etc/rc.config.d ROUTE&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 09 Nov 2006 10:41:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895513#M282129</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-11-09T10:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to search srings in OS?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895514#M282130</link>
      <description>I always use this for me:&lt;BR /&gt;&lt;BR /&gt;passing grep to find in back quotes ` `&lt;BR /&gt;&lt;BR /&gt;grep -n "hello" `find /full/path/* -type f -print`&lt;BR /&gt;&lt;BR /&gt;where n is the line number.&lt;BR /&gt;&lt;BR /&gt;If argument list is too long,&lt;BR /&gt;then loop by directory.&lt;BR /&gt;&lt;BR /&gt;Let me know if you want to know how.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Nov 2006 11:11:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895514#M282130</guid>
      <dc:creator>Frank de Vries</dc:creator>
      <dc:date>2006-11-09T11:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to search srings in OS?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895515#M282131</link>
      <description>if I do not want to search in /tmp.&lt;BR /&gt;how can I do</description>
      <pubDate>Thu, 09 Nov 2006 21:10:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895515#M282131</guid>
      <dc:creator>lin.chen</dc:creator>
      <dc:date>2006-11-09T21:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to search srings in OS?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895516#M282132</link>
      <description>If you don't want to search /tmp, don't specify it in your find command.</description>
      <pubDate>Thu, 09 Nov 2006 21:26:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895516#M282132</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2006-11-09T21:26:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to search srings in OS?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895517#M282133</link>
      <description>Hi Lin:&lt;BR /&gt;&lt;BR /&gt;You can specify multiple directories to search when you use 'find':&lt;BR /&gt;&lt;BR /&gt;# find /usr /var /opt -xdev -type f -print&lt;BR /&gt;&lt;BR /&gt;The use of '-xdev' prevents 'find' from traversing mountpoints.  This is most useful if you want to search the root directory ('/') but *not* mountpoints like '/usr', '/var' etc.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 09 Nov 2006 21:48:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-search-srings-in-os/m-p/3895517#M282133</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-11-09T21:48:32Z</dc:date>
    </item>
  </channel>
</rss>

