snipt

Ctrl+h for KB shortcuts

Text only

Solaris Recursive Grep

1
2
3
4
5
6
7
8
^^ How do I do a recursive grep?

   1. Method 1 (recommended)
         1. /usr/bin/find . | /usr/bin/xargs /usr/bin/grep PATTERN
         2. displays filename:match 
   2. Method 2 (recommended)
         1. /usr/bin/find . -exec /usr/bin/grep PATTERN {} /dev/null \;
         2. displays filename:match 
https://snipt.net/embed/55c96c028fbb14973621a8266664574b/
/raw/55c96c028fbb14973621a8266664574b/
55c96c028fbb14973621a8266664574b
text
Text only
9
2019-06-16T02:59:17
True
False
False
/api/public/snipt/1566/
solaris-recursive-grep
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>^^ How do I do a recursive grep? </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a> 1. Method 1 (recommended) </span><span id="L-4"><a name="L-4"></a> 1. /usr/bin/find . | /usr/bin/xargs /usr/bin/grep PATTERN </span><span id="L-5"><a name="L-5"></a> 2. displays filename:match </span><span id="L-6"><a name="L-6"></a> 2. Method 2 (recommended) </span><span id="L-7"><a name="L-7"></a> 1. /usr/bin/find . -exec /usr/bin/grep PATTERN {} /dev/null \; </span><span id="L-8"><a name="L-8"></a> 2. displays filename:match </span></pre></div> </td></tr></table>
grep, recursive, solaris