<?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 recursive grep in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612155#M36451</link>
    <description>Can I grep recursively?  I have a directory that has directories and I want to search the whole structure for a string - is there a way to do this?</description>
    <pubDate>Mon, 12 Nov 2001 17:30:56 GMT</pubDate>
    <dc:creator>Dee_3</dc:creator>
    <dc:date>2001-11-12T17:30:56Z</dc:date>
    <item>
      <title>recursive grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612155#M36451</link>
      <description>Can I grep recursively?  I have a directory that has directories and I want to search the whole structure for a string - is there a way to do this?</description>
      <pubDate>Mon, 12 Nov 2001 17:30:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612155#M36451</guid>
      <dc:creator>Dee_3</dc:creator>
      <dc:date>2001-11-12T17:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: recursive grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612156#M36452</link>
      <description>find /dir -type f -exec grep -l stringhere {} \;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Mon, 12 Nov 2001 17:33:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612156#M36452</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-11-12T17:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: recursive grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612157#M36453</link>
      <description>Hi Terri:&lt;BR /&gt;&lt;BR /&gt;# cd thedirectory&lt;BR /&gt;# find . -type -f -print | xargs grep string&lt;BR /&gt;&lt;BR /&gt;This will recursively search the current directory and all subdirectories looking for *files* only which contain the the string "string".  The use of 'xargs' in lieu of '-exec' with the the 'find' utility is less resource intensive.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 12 Nov 2001 17:35:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612157#M36453</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-11-12T17:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: recursive grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612158#M36454</link>
      <description>find $DIR -type f | xargs grep &lt;SEARCHSTRING&gt;&lt;BR /&gt;&lt;BR /&gt;-raj&lt;/SEARCHSTRING&gt;</description>
      <pubDate>Mon, 12 Nov 2001 17:36:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612158#M36454</guid>
      <dc:creator>Roger Baptiste</dc:creator>
      <dc:date>2001-11-12T17:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: recursive grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612159#M36455</link>
      <description>Terri,&lt;BR /&gt;&lt;BR /&gt;Also, if you know that the file is less than say 1mb (1000000) then you can add that knowledge to "find":&lt;BR /&gt;&lt;BR /&gt;find /searchdir -type f -size -1000000c -exec grep -l {} \;&lt;BR /&gt;&lt;BR /&gt;If you aren't sure about case add the "i" option to the grep:&lt;BR /&gt;&lt;BR /&gt;find /searchdir -type f -size -1000000c -exec grep -il {} \;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Mon, 12 Nov 2001 17:42:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612159#M36455</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2001-11-12T17:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: recursive grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612160#M36456</link>
      <description>I hate the garbage that results from grep'ing a compiled executable or data file.&lt;BR /&gt;&lt;BR /&gt;alias regrep="find . -type f | xargs file | grep text | grep -v awk|sed 's/://' | cut -f 1| xargs grep -i"&lt;BR /&gt;&lt;BR /&gt;Yes, it's a bit convoluted (thus the alias), but it works.</description>
      <pubDate>Mon, 12 Nov 2001 20:15:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612160#M36456</guid>
      <dc:creator>Alan Riggs</dc:creator>
      <dc:date>2001-11-12T20:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: recursive grep</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612161#M36457</link>
      <description>Hi Terri,&lt;BR /&gt;&lt;BR /&gt;The other trick I do is:&lt;BR /&gt;&lt;BR /&gt;find . -type f | xargs grep string /dev/null&lt;BR /&gt;&lt;BR /&gt;You know /dev/null can *never* contain the string...but, since the grep now has more than one filename in its file list, it will print the matching line + the name of the matching file.&lt;BR /&gt;&lt;BR /&gt;Rgds, Robin&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Nov 2001 23:36:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/recursive-grep/m-p/2612161#M36457</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-11-12T23:36:38Z</dc:date>
    </item>
  </channel>
</rss>

