<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>shell &amp;mdash; sandeepk</title>
    <link>https://blogs.dgplug.org/sandeepk/tag:shell</link>
    <description></description>
    <pubDate>Sun, 19 Apr 2026 07:40:12 +0000</pubDate>
    <item>
      <title>Shell: Day #5</title>
      <link>https://blogs.dgplug.org/sandeepk/shell-day-5</link>
      <description>&lt;![CDATA[Today go through the commands to monitor processes and how to handle them&#xA;&#xA;ps - It reports the snapshot of the current process&#xA;init- It the parent process of all the processes.&#xA;pstree - Same as ps but list the process in form of tree with more details.&#xA;top- List down all the process running, update the snapshot after a while.&#xA;Kill - it signals the process &#xA;     INT - 2 -Interrupt, stop running&#xA;     TERM - 15 - ask a process to exit gracefully&#xA;     KILL - 9 - force the process to stop running &#xA;     TSTP - 18 - request the process to stop temporarily&#xA;     HUP - 1 - Hang up &#xA;nice - Every process run has priority and with nice we can control this priority, it ranges from +19(very nice) to -20(not very nice) decreased niceness higher the priority&#xA;renice- change the priority of the existing process&#xA;&#xA;    top&#xA;PID  User  PR  NI  VIRT     RES     SHR     S  %CPU %MEM Time+ Command&#xA;3911 user  20   0 2855988 206872 141304 S  72.2  2.6   7:15.09 Web Content                                                                       &#xA;31980 user  20   0 3703988 509176 188188 S  33.3  6.3  49:36.10 firefox                                                                           &#xA; 2839 user  20   0 2834092 191744 128268 S  27.8  2.4  16:13.39 Web Content    &#xA;&#xA;    ps&#xA;  PID TTY          TIME CMD&#xA; 2418 pts/2    00:00:00 zsh&#xA; 4318 pts/2    00:00:00 ps&#xA;&#xA;    pstree | less&#xA;systemd-+-NetworkManager-+-dhclient&#xA;        |                |-dnsmasq---dnsmasq&#xA;        |                |-{gdbus}&#xA;        |                `-{gmain}&#xA;        |-accounts-daemon-+-{gdbus}&#xA;        |                 `-{gmain}&#xA;        |-acpid&#xA;        |-agetty&#xA;        |-apache2---2[apache2---26[{apache2}]]&#xA;        |-at-spi-bus-laun-+-{dconf worker}&#xA;        |                 |-{gdbus}&#xA;        |                 `-{gmain}&#xA;...&#xA;    nice -n 10 long-running-command &amp;&#xA;    renice 20 2984&#xA;    renice 15 -u mike # changing  niceness for all process of mike user&#xA;    kill -9 PID&#xA;&#xA;shell&#xA;dgplug&#xA;ilugc&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Today go through the commands to monitor processes and how to handle them</p>
<ul><li>ps – It reports the snapshot of the current process</li>
<li>init- It the parent process of all the processes.</li>
<li>pstree – Same as <em>ps</em> but list the process in form of tree with more details.</li>
<li>top- List down all the process running, update the snapshot after a while.</li>
<li>Kill – it signals the process
<ul><li>INT – 2 -Interrupt, stop running</li>
<li>TERM – 15 – ask a process to exit gracefully</li>
<li>KILL – 9 – force the process to stop running</li>
<li>TSTP – 18 – request the process to stop temporarily</li>
<li>HUP – 1 – Hang up</li></ul></li>
<li>nice – Every process run has priority and with nice we can control this priority, it ranges from +19(very nice) to -20(not very nice) decreased niceness higher the priority</li>
<li>renice- change the priority of the existing process</li></ul>

<pre><code class="language-bash">
&gt;&gt; top
PID  User  PR  NI  VIRT     RES     SHR     S  %CPU %MEM Time+ Command
3911 user  20   0 2855988 206872 141304 S  72.2  2.6   7:15.09 Web Content                                                                       
31980 user  20   0 3703988 509176 188188 S  33.3  6.3  49:36.10 firefox                                                                           
 2839 user  20   0 2834092 191744 128268 S  27.8  2.4  16:13.39 Web Content    

&gt;&gt;ps
  PID TTY          TIME CMD
 2418 pts/2    00:00:00 zsh
 4318 pts/2    00:00:00 ps

&gt;&gt; pstree | less
systemd-+-NetworkManager-+-dhclient
        |                |-dnsmasq---dnsmasq
        |                |-{gdbus}
        |                `-{gmain}
        |-accounts-daemon-+-{gdbus}
        |                 `-{gmain}
        |-acpid
        |-agetty
        |-apache2---2*[apache2---26*[{apache2}]]
        |-at-spi-bus-laun-+-{dconf worker}
        |                 |-{gdbus}
        |                 `-{gmain}
...
&gt;&gt; nice -n 10 long-running-command &amp;
&gt;&gt;renice 20 2984
&gt;&gt;renice 15 -u mike # changing  niceness for all process of mike user
&gt;&gt; kill -9 PID
</code></pre>

<p><a href="/sandeepk/tag:shell" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">shell</span></a>
<a href="/sandeepk/tag:dgplug" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">dgplug</span></a>
<a href="/sandeepk/tag:ilugc" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">ilugc</span></a></p>
]]></content:encoded>
      <guid>https://blogs.dgplug.org/sandeepk/shell-day-5</guid>
      <pubDate>Mon, 13 Jul 2020 18:36:08 +0000</pubDate>
    </item>
  </channel>
</rss>