{"id":1102,"date":"2020-10-20T11:13:18","date_gmt":"2020-10-20T11:13:18","guid":{"rendered":"https:\/\/blog.samarthya.me\/wps\/?p=1102"},"modified":"2020-10-21T08:23:00","modified_gmt":"2020-10-21T08:23:00","slug":"ps-process-status","status":"publish","type":"post","link":"https:\/\/blog.samarthya.me\/wps\/2020\/10\/20\/ps-process-status\/","title":{"rendered":"PS: Process Status"},"content":{"rendered":"\n<p>MAN Pages are one source of truth for all curious queries.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>man ps<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Name\n   ps - report a snapshot of the current processes.<\/code><\/pre>\n\n\n\n<p>It is used to display instant information about the active processes in the system.<\/p>\n\n\n\n<p>It accepts multiple types of arguments<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>UNIX<\/strong> options, which may be grouped and must be preceded by a dash.<\/li><li><strong>BSD<\/strong> options, which may be grouped and must not be used with a dash.<\/li><li><strong>GNU<\/strong> long options, which are preceded by two dashes.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Examples<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>ps aux<\/code><\/pre>\n\n\n\n<p>It lists out all the processes running. In my system<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps aux|wc -l<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>root@node1>ps aux|wc -l\n244<\/code><\/pre>\n\n\n\n<p><code>243<\/code> processes &#8211; excluding the heading.<\/p>\n\n\n\n<p>The ps command reads the\u00a0<code>\/proc<\/code>\u00a0filesystem which is RAM based or virtual file system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mount -l|grep proc<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>proc on \/proc type proc (rw,nosuid,nodev,noexec,relatime)\nsystemd-1 on \/proc\/sys\/fs\/binfmt_misc type autofs (rw,relatime,fd=31,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=29236)\nproc on \/run\/docker\/netns\/ingress_sbox type proc (rw,nosuid,nodev,noexec,relatime)\nproc on \/run\/docker\/netns\/default type proc (rw,nosuid,nodev,noexec,relatime)\nproc on \/run\/docker\/netns\/1-k52v1yjsgr type proc (rw,nosuid,nodev,noexec,relatime)\nproc on \/run\/docker\/netns\/e57f884c0d0f type proc (rw,nosuid,nodev,noexec,relatime)<\/code><\/pre>\n\n\n\n<p>To see the process tree<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps -e --forest<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code> PID TTY          TIME CMD\n     2 ?        00:00:00 kthreadd\n     4 ?        00:00:00  \\_ kworker\/0:0H\n     6 ?        00:00:00  \\_ ksoftirqd\/0\n     7 ?        00:00:01  \\_ migration\/0\n     8 ?        00:00:00  \\_ rcu_bh\n     9 ?        00:30:31  \\_ rcu_sched\n    10 ?        00:00:00  \\_ lru-add-drain\n    11 ?        00:00:07  \\_ watchdog\/0\n    12 ?        00:00:06  \\_ watchdog\/1\n    13 ?        00:00:01  \\_ migration\/1\n    14 ?        00:00:01  \\_ ksoftirqd\/1\n    16 ?        00:00:00  \\_ kworker\/1:0H\n    17 ?        00:00:05  \\_ watchdog\/2\n    18 ?        00:00:04  \\_ migration\/2\n    19 ?        00:00:00  \\_ ksoftirqd\/2\n    21 ?        00:00:00  \\_ kworker\/2:0H\n    22 ?        00:00:05  \\_ watchdog\/3\n    23 ?        00:00:04  \\_ migration\/3\n    24 ?        00:00:00  \\_ ksoftirqd\/3\n    26 ?        00:00:00  \\_ kworker\/3:0H\n    27 ?        00:00:05  \\_ watchdog\/4\n    28 ?        00:00:03  \\_ migration\/4<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>MAN Pages are one source of truth for all curious queries. It is used to display instant information about the active processes in the system. It accepts multiple types of arguments UNIX options, which may be grouped and must be preceded by a dash. BSD options, which may be grouped and must not be used [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1106,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[34],"tags":[112,116],"class_list":["post-1102","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-technical","tag-linux","tag-technical","post_format-post-format-image"],"_links":{"self":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/1102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/comments?post=1102"}],"version-history":[{"count":0,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/1102\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media\/1106"}],"wp:attachment":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media?parent=1102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/categories?post=1102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/tags?post=1102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}