snipt

Ctrl+h for KB shortcuts

Bash

Search zombie process in linux with awk or without awk

1
2
3
4
5
#more effective, using awk
ps aux | awk '{ print $8 " " $2 }' | grep -w Z

#less effective, without awk
ps -el | grep 'Z'
https://snipt.net/embed/3bc0b112edf34393e223f18bd9b6d361/
/raw/3bc0b112edf34393e223f18bd9b6d361/
3bc0b112edf34393e223f18bd9b6d361
bash
Bash
5
2019-07-14T15:37:24
True
False
False
/api/public/snipt/45495/
search-zombie-process-in-linux-with-awk-or-without-awk
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1">#more effective, using awk</span> </span><span id="L-2"><a name="L-2"></a>ps aux <span class="p">|</span> awk <span class="s1">&#39;{ print $8 &quot; &quot; $2 }&#39;</span> <span class="p">|</span> grep -w Z </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1">#less effective, without awk</span> </span><span id="L-5"><a name="L-5"></a>ps -el <span class="p">|</span> grep <span class="s1">&#39;Z&#39;</span> </span></pre></div> </td></tr></table>
"search zombie process", awk, bash, linux, process, sh, zombie

Bash

Find all files by extension in a directory recursively

find directory/ -name \*.txt -print
https://snipt.net/embed/80b8c205e59dafa2b74aaef8ad089f91/
/raw/80b8c205e59dafa2b74aaef8ad089f91/
80b8c205e59dafa2b74aaef8ad089f91
bash
Bash
1
2019-07-15T16:32:01
True
False
False
Aug 10, 2012 at 06:59 AM
/api/public/snipt/45493/
find-all-files-by-extension-in-a-directory-recursively
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>find directory/ -name <span class="se">\*</span>.txt -print </span></pre></div> </td></tr></table>
all, bash, directory, extension, files, find, linux, recursive, recursively, sh