<?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 a word in in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054926#M93729</link>
    <description>grep doesn't take its list of files from stdin.  You must use:&lt;BR /&gt;$ find . -type f -exec grep "hi" {} +&lt;BR /&gt;&lt;BR /&gt;2) to find .cpp:&lt;BR /&gt;$ find . -type f -name "*.cpp" -exec grep "hi" {} +&lt;BR /&gt;&lt;BR /&gt;3) Why would you settle using xargs when you can use -exec {} +?&lt;BR /&gt;Yes, you could use xargs in your original example.</description>
    <pubDate>Tue, 26 Jun 2007 02:20:22 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2007-06-26T02:20:22Z</dc:date>
    <item>
      <title>How to search a word in</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054925#M93728</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;  Can i know what is the command to search for a word in subsequent directories.&lt;BR /&gt;&lt;BR /&gt; 1) I am using &lt;BR /&gt;    find . -type f -print | grep "hi" * &lt;BR /&gt;       but it is not working please correct me if i am wrong.&lt;BR /&gt;  2)   Also  what should i do if i want to search in a particular files of subsequent directories &lt;BR /&gt;        ex- if i wnat to search the word "hi" i only the *.cpp files&lt;BR /&gt;&lt;BR /&gt; 3) Cant we use xargs in HP- UNIX or is there any alternative for this. &lt;BR /&gt;&lt;BR /&gt;Please suggest some solutions for the above queries.&lt;BR /&gt;&lt;BR /&gt;thanks in advance &lt;BR /&gt;Vikram</description>
      <pubDate>Tue, 26 Jun 2007 02:04:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054925#M93728</guid>
      <dc:creator>CA1490051</dc:creator>
      <dc:date>2007-06-26T02:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a word in</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054926#M93729</link>
      <description>grep doesn't take its list of files from stdin.  You must use:&lt;BR /&gt;$ find . -type f -exec grep "hi" {} +&lt;BR /&gt;&lt;BR /&gt;2) to find .cpp:&lt;BR /&gt;$ find . -type f -name "*.cpp" -exec grep "hi" {} +&lt;BR /&gt;&lt;BR /&gt;3) Why would you settle using xargs when you can use -exec {} +?&lt;BR /&gt;Yes, you could use xargs in your original example.</description>
      <pubDate>Tue, 26 Jun 2007 02:20:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054926#M93729</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-06-26T02:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a word in</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054927#M93730</link>
      <description>Hi Vikram&lt;BR /&gt;&lt;BR /&gt;1)&lt;BR /&gt;find . -type f -exec grep "hi" {} \+&lt;BR /&gt;&lt;BR /&gt;2)&lt;BR /&gt;give -name "*cpp" as additional parameter to find:&lt;BR /&gt;&lt;BR /&gt;find . -type f -name "*cpp" -exec grep hi {} \+&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;3) you can use xargs:&lt;BR /&gt;find . -type f | xargs grep "hi"&lt;BR /&gt;&lt;BR /&gt;but beware of HP-UX find does not have -print0, thus you may have problems with Path/filenames with spaces.&lt;BR /&gt;&lt;BR /&gt;rgds&lt;BR /&gt;HGH&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Jun 2007 02:21:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054927#M93730</guid>
      <dc:creator>Hemmetter</dc:creator>
      <dc:date>2007-06-26T02:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a word in</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054928#M93731</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;   Thank you very much for the solutions.&lt;BR /&gt;&lt;BR /&gt;   I am able to search the word in subsequent directories using the command&lt;BR /&gt;&lt;BR /&gt;find . -type f -exec grep hi \+ | more&lt;BR /&gt;&lt;BR /&gt;  but the problem is if i dont give more, it is crashing the terminal i think it is getting into some infinite loop. &lt;BR /&gt;&lt;BR /&gt;   Please suggest some solution for this.&lt;BR /&gt;&lt;BR /&gt;thanks &amp;amp; regards&lt;BR /&gt;Vikram&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Jun 2007 05:07:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054928#M93731</guid>
      <dc:creator>CA1490051</dc:creator>
      <dc:date>2007-06-26T05:07:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a word in</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054929#M93732</link>
      <description>&amp;gt;but the problem is if i dont give more, it is crashing the terminal i think it is getting into some infinite loop.&lt;BR /&gt;&lt;BR /&gt;You could finding "hi" in binary files.  Send the output to a file then vi/more the file.</description>
      <pubDate>Tue, 26 Jun 2007 05:24:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054929#M93732</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-06-26T05:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a word in</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054930#M93733</link>
      <description>To know the only the file names(grep -l) and using more on that use:&lt;BR /&gt;&lt;BR /&gt;With -exec in find command&lt;BR /&gt;            find ./ -type f -name "*.cpp" -exec grep -l hi {} \; | more&lt;BR /&gt;&lt;BR /&gt;With xargs command&lt;BR /&gt;            find ./ -type f -name "*.edi" | xargs grep -l 111111111 | more</description>
      <pubDate>Tue, 26 Jun 2007 23:42:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054930#M93733</guid>
      <dc:creator>MurugesanGCT</dc:creator>
      <dc:date>2007-06-26T23:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a word in</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054931#M93734</link>
      <description>Thank you very much to all.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 27 Jun 2007 22:54:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-search-a-word-in/m-p/5054931#M93734</guid>
      <dc:creator>CA1490051</dc:creator>
      <dc:date>2007-06-27T22:54:05Z</dc:date>
    </item>
  </channel>
</rss>

