snipt

Ctrl+h for KB shortcuts

Bash

kill process specified in pid file

$ kill -9 $(<tmp/pids/server.pid); rails s
https://snipt.net/embed/7d9a4935c5a281c68714a9154fcc1490/
https://snipt.net/raw/7d9a4935c5a281c68714a9154fcc1490/
7d9a4935c5a281c68714a9154fcc1490
bash
Bash
1
2016-09-22T11:20:52
True
False
False
/api/public/snipt/56294/
kill-process-specified-in-pid-file
<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 id="L-1"><a name="L-1"></a><span class="nv">$ </span><span class="nb">kill</span> -9 <span class="k">$(</span>&lt;tmp/pids/server.pid<span class="k">)</span><span class="p">;</span> rails s </span></pre></div> </td></tr></table>
kill, linux, pid, process

Bash

Renice a bash shell and all processes launched from it

renice +5 -p $BASHPID
https://snipt.net/embed/50d00cc74b9c47d0332c983c7c5f0efb/
https://snipt.net/raw/50d00cc74b9c47d0332c983c7c5f0efb/
50d00cc74b9c47d0332c983c7c5f0efb
bash
Bash
1
2016-09-13T22:49:46
True
False
False
/api/public/snipt/28221/
renice-a-bash-shell-and-all-processes-launched-from-it
<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 id="L-1"><a name="L-1"></a>renice +5 -p <span class="nv">$BASHPID</span> </span></pre></div> </td></tr></table>
cli, nice, pid, shell

Bash

Show processes sorted by RSS (resident set size)

ps -e -orss=,pid=,args= | sort -b -k1,1n | pr -TW$COLUMNS
https://snipt.net/embed/81842f43c1ce9bd8a79c60d22078c2a7/
https://snipt.net/raw/81842f43c1ce9bd8a79c60d22078c2a7/
81842f43c1ce9bd8a79c60d22078c2a7
bash
Bash
1
2016-09-28T10:05:35
True
False
False
/api/public/snipt/5010/
show-processes-sorted-by-rss-resident-set-size
<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 id="L-1"><a name="L-1"></a>ps -e -orss<span class="o">=</span>,pid<span class="o">=</span>,args<span class="o">=</span> <span class="p">|</span> sort -b -k1,1n <span class="p">|</span> pr -TW<span class="nv">$COLUMNS</span> </span></pre></div> </td></tr></table>
bash, pid, pr, ps, rss, sort
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.