<?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: grep recursive in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863358#M98436</link>
    <description>Hi,&lt;BR /&gt;thanks to reply. Due a delay of forum i cannot submit points(the therad was closed..) ..i would 10 point for you!&lt;BR /&gt;&lt;BR /&gt;Best regards.&lt;BR /&gt;Francesco&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 15 Sep 2006 07:19:09 GMT</pubDate>
    <dc:creator>Francesco_13</dc:creator>
    <dc:date>2006-09-15T07:19:09Z</dc:date>
    <item>
      <title>grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863349#M98427</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;how i can find the word "force" in all text file of my hp-ux system? &lt;BR /&gt;grep -i force *    find in executables file too..&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;&lt;BR /&gt;Best regards.&lt;BR /&gt;Francesco</description>
      <pubDate>Fri, 15 Sep 2006 03:51:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863349#M98427</guid>
      <dc:creator>Francesco_13</dc:creator>
      <dc:date>2006-09-15T03:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863350#M98428</link>
      <description>you won't be able to find word from executables using grep command. you have to use strings first and then use grep command to find the words.</description>
      <pubDate>Fri, 15 Sep 2006 03:57:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863350#M98428</guid>
      <dc:creator>IT_2007</dc:creator>
      <dc:date>2006-09-15T03:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863351#M98429</link>
      <description>like &lt;BR /&gt;&lt;BR /&gt;strings /etc/lvmtab |grep "vg"&lt;BR /&gt;&lt;BR /&gt;  which will show you only names with vg.</description>
      <pubDate>Fri, 15 Sep 2006 03:59:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863351#M98429</guid>
      <dc:creator>IT_2007</dc:creator>
      <dc:date>2006-09-15T03:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863352#M98430</link>
      <description>Hi,&lt;BR /&gt;i wolud find recursively where i have the word 'force' in all my files in the system...&lt;BR /&gt;&lt;BR /&gt;with you suggested command i can do it this?&lt;BR /&gt;&lt;BR /&gt;thanks and regards&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Sep 2006 04:05:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863352#M98430</guid>
      <dc:creator>Francesco_13</dc:creator>
      <dc:date>2006-09-15T04:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863353#M98431</link>
      <description>Use the find command in conjunction with grep:&lt;BR /&gt;&lt;BR /&gt;find /start_dir -type f -exec grep -l "force" {} \;&lt;BR /&gt;&lt;BR /&gt;Be warned, however, that binary files will do not grep well.  Ideally you would need to find some way to exclude binaries, perhaps by being more selective about which directories you "find" in.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 15 Sep 2006 05:21:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863353#M98431</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-09-15T05:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863354#M98432</link>
      <description>thanks to all. &lt;BR /&gt;Question solved.&lt;BR /&gt;&lt;BR /&gt;regards.&lt;BR /&gt;Francesco</description>
      <pubDate>Fri, 15 Sep 2006 05:54:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863354#M98432</guid>
      <dc:creator>Francesco_13</dc:creator>
      <dc:date>2006-09-15T05:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863355#M98433</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Using '-exec' with 'find' causes a separate process to be forked for every file found.  This can be very detrimental to your system's performance.&lt;BR /&gt;&lt;BR /&gt;Secondly, you should add '-xdev' so that you do not cross mountpoints as 'find' descends directories.  This would be *very* important if you were interested in searching the root 'root' filesystem (including '/etc' which is not a separate mountpoint but excluding trees like '/usr' and '/opt' which are there own mountpoints.&lt;BR /&gt;&lt;BR /&gt;Thus, at a minimum, do:&lt;BR /&gt;&lt;BR /&gt;# find /path -xdev -type f | xargs grep -i force&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Sep 2006 06:00:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863355#M98433</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-09-15T06:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863356#M98434</link>
      <description>Francesco,&lt;BR /&gt;variation on a theme:&lt;BR /&gt;grep force `find / -exec file {} \; | grep -v directory | grep -v executable | awk -F':' '{print $1}'`&lt;BR /&gt;&lt;BR /&gt;This should exclude directories and execuatble as defined by file (man file)&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Sep 2006 06:06:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863356#M98434</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2006-09-15T06:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863357#M98435</link>
      <description>&lt;!--!*#--&gt;Hi (again) Francesco:&lt;BR /&gt;&lt;BR /&gt;[ It's taken an hour to be able to post this...the Forum has been out-to-lunch ]&lt;BR /&gt;&lt;BR /&gt;If you want to be able to restrict your 'grep' to only text files ( and not binary ones ) and in addition identify each file matching the pattern you specify, use:&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} -xdev -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;exit 0&lt;BR /&gt;&lt;BR /&gt;...run as:&lt;BR /&gt;&lt;BR /&gt;# ./google /path pattern&lt;BR /&gt;&lt;BR /&gt;for example:&lt;BR /&gt;&lt;BR /&gt;# ./google /etc hostname&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Fri, 15 Sep 2006 07:14:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863357#M98435</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-09-15T07:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863358#M98436</link>
      <description>Hi,&lt;BR /&gt;thanks to reply. Due a delay of forum i cannot submit points(the therad was closed..) ..i would 10 point for you!&lt;BR /&gt;&lt;BR /&gt;Best regards.&lt;BR /&gt;Francesco&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Sep 2006 07:19:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863358#M98436</guid>
      <dc:creator>Francesco_13</dc:creator>
      <dc:date>2006-09-15T07:19:09Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863359#M98437</link>
      <description>Francesco,&lt;BR /&gt;&lt;BR /&gt;You can still assign JRF the points he deserves.  Click on the "reopen thread" button, then assign the points, then click on the "close thread" button.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Fri, 15 Sep 2006 07:22:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863359#M98437</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2006-09-15T07:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863360#M98438</link>
      <description>Francesco,&lt;BR /&gt;&lt;BR /&gt;Thread is not closed. Please assign points to JRF. He deserves it. &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;IT_2007</description>
      <pubDate>Fri, 15 Sep 2006 08:15:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863360#M98438</guid>
      <dc:creator>IT_2007</dc:creator>
      <dc:date>2006-09-15T08:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863361#M98439</link>
      <description>Hi,&lt;BR /&gt;ok, before weekend was be problematic connect with forum. This morning it's ok! assigned points.&lt;BR /&gt;we can close the thread.&lt;BR /&gt;thanks to all&lt;BR /&gt; regards.&lt;BR /&gt;Francesco</description>
      <pubDate>Mon, 18 Sep 2006 01:26:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863361#M98439</guid>
      <dc:creator>Francesco_13</dc:creator>
      <dc:date>2006-09-18T01:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863362#M98440</link>
      <description>Hi,&lt;BR /&gt;when i run the script from / of my hp-ux, after several minutes i receive this error:&lt;BR /&gt;/usr/bin/grep: The parameter list is too long.&lt;BR /&gt;I donÂ´t know where have stopped.&lt;BR /&gt;&lt;BR /&gt;i use:&lt;BR /&gt;grep -i force `find / -exec file {} \; | grep -v directory | grep -v executable | awk -F':' '&lt;BR /&gt;{print $1}'`&lt;BR /&gt;&lt;BR /&gt;How i can remove this problem?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Best regards.&lt;BR /&gt;&lt;BR /&gt;Francesco&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Sep 2006 02:48:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863362#M98440</guid>
      <dc:creator>Francesco_13</dc:creator>
      <dc:date>2006-09-18T02:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863363#M98441</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;for the other option with:&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;typeset DIR=$1&lt;BR /&gt;typeset PAT=$2&lt;BR /&gt;find ${DIR} -xdev -type f | while read FILE&lt;BR /&gt;do&lt;BR /&gt;    [ `file ${FILE} | grep -ic ascii` -eq 0 ] &amp;amp;&amp;amp; continue&lt;BR /&gt;    grep "$PAT" ${FILE} /dev/null&lt;BR /&gt;done&lt;BR /&gt;exit&lt;BR /&gt;&lt;BR /&gt;I have introduced -i option for uppercase. But one question: how i can do it for find only word "force" and no returning me other words how for example "forced" where force it's present?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;BR /&gt;&lt;BR /&gt;Best regards.&lt;BR /&gt;Francesco</description>
      <pubDate>Mon, 18 Sep 2006 03:08:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863363#M98441</guid>
      <dc:creator>Francesco_13</dc:creator>
      <dc:date>2006-09-18T03:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863364#M98442</link>
      <description>Hi (again) Francesco:&lt;BR /&gt;&lt;BR /&gt;A simple 'grep' will match the string of characters without regard to where they occur.  A simple solution for finding only the word "force" would be:&lt;BR /&gt;&lt;BR /&gt;# grep -i -e "^force " -e " force$" -e " force "&lt;BR /&gt;&lt;BR /&gt;The caret (^) anchors the string to the beginning of a line.   The dollar sign ($) anchors the string at the line's end.  Surrounding the string with spaaces " " creates the sense of an English word.&lt;BR /&gt;&lt;BR /&gt;In answer to your question regarding Peter's script, the "parameter list is too long" error arises because the 'find' is creating a list of files for input the 'grep'.  The list generated is too long to be passed to 'grep' in one unit.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 18 Sep 2006 05:23:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863364#M98442</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2006-09-18T05:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: grep recursive</title>
      <link>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863365#M98443</link>
      <description>&lt;P&gt;&amp;gt;grep -i force `find / -exec file {} \; | grep -v directory | grep -v executable | awk -F':' '&lt;BR /&gt;{print $1}'`&lt;BR /&gt;&lt;BR /&gt;Peter's script is not the proper way to use find, if it will return an infinite number of files. You must use xargs or better yet use -exec grep +.&lt;BR /&gt;&lt;BR /&gt;It seems you can only use -exec file +. But you shouldn't use `find ...`.&lt;BR /&gt;&lt;BR /&gt;You need to replace by:&lt;BR /&gt;&lt;BR /&gt;find / -exec file + | \&lt;BR /&gt;grep -v -e directory -e executable | \&lt;BR /&gt;awk -F":" '{print $1}' | xargs -n40 grep -i force&lt;BR /&gt;&lt;BR /&gt;You may want to add 2&amp;gt; /dev/null to the find and the last grep.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;how i can do it for find only word "force" and no returning me other words how for example "forced" where force it's present?&lt;BR /&gt;&lt;BR /&gt;You need to use grep -w. (If you are on 11.11) This is easier than James' solution. Otherwise a more rigorous solution for 11.00 would use&lt;/P&gt;&lt;P&gt;[[:space:][:punct:]] where he has a blank, before and after your word "force".&lt;/P&gt;</description>
      <pubDate>Sun, 30 Oct 2011 02:10:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/grep-recursive/m-p/3863365#M98443</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-10-30T02:10:44Z</dc:date>
    </item>
  </channel>
</rss>

