snipt

Ctrl+h for KB shortcuts

Bash

recursive command to perform sudo actions

1
2
3
// linux: recursive command to perform sudo actions

find . -print  | sed -e 's/^/\"/' -e 's/$/\"/' | xargs sudo ...
https://snipt.net/embed/d24229297e9246d48803739366ae914d/
/raw/d24229297e9246d48803739366ae914d/
d24229297e9246d48803739366ae914d
bash
Bash
4
2019-07-14T13:08:37
True
False
False
/api/public/snipt/9714/
recursive-command-to-perform-sudo-actions
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>// linux: recursive <span class="nb">command</span> to perform sudo actions </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>find . -print <span class="p">|</span> sed -e <span class="s1">&#39;s/^/\&quot;/&#39;</span> -e <span class="s1">&#39;s/$/\&quot;/&#39;</span> <span class="p">|</span> xargs sudo ... </span></pre></div> </td></tr></table>
cmd, find, linux, sudo