{"id":11308,"date":"2019-03-13T00:22:30","date_gmt":"2019-03-13T00:22:30","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=11308"},"modified":"2019-03-13T00:22:30","modified_gmt":"2019-03-13T00:22:30","slug":"30-useful-ps-command-examples-for-linux-process-monitoring","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/13\/30-useful-ps-command-examples-for-linux-process-monitoring\/","title":{"rendered":"30 Useful \u2018ps Command\u2019 Examples for Linux Process Monitoring"},"content":{"rendered":"<p><strong>ps<\/strong>\u00a0(<strong>processes status<\/strong>) is a native Unix\/Linux utility for viewing information concerning a selection of running processes on a system: it reads this information from the virtual files in\u00a0<a href=\"https:\/\/www.tecmint.com\/exploring-proc-file-system-in-linux\/\" target=\"_blank\" rel=\"noopener\">\/proc filesystem<\/a>. It is one of the important utilities for system administration specifically under process monitoring, to help you understand whats is going on a Linux system.<\/p>\n<p>It has numerous options for manipulating its output, however you\u2019ll find a small number of them practically useful for daily usage.<\/p>\n<p><strong>Read Also<\/strong>:\u00a0<a href=\"https:\/\/www.tecmint.com\/linux-process-management\/\" target=\"_blank\" rel=\"noopener\">All You Need To Know About Processes in Linux [Comprehensive Guide]<\/a><\/p>\n<p>In this article, we\u2019ll look at 30 useful examples of ps commands for monitoring active running processes on a Linux system.<\/p>\n<p>Note that\u00a0<strong>ps<\/strong>\u00a0produces output with a heading line, which represents the meaning of each column of information, you can find the meaning of all the labels in the\u00a0<strong>ps man page<\/strong>.<\/p>\n<h3>List All Processes in Current Shell<\/h3>\n<p><strong>1.<\/strong>\u00a0If you run\u00a0<strong>ps command<\/strong>\u00a0without any arguments, it displays processes for the current shell.<\/p>\n<pre>$ ps \r\n<\/pre>\n<div id=\"attachment_27069\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27069\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Current-Running-Processes.png\" alt=\"List Current Running Processes\" width=\"422\" height=\"97\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List Current Running Processes<\/p>\n<\/div>\n<h3>Print All Processes in Different Formats<\/h3>\n<p><strong>2.<\/strong>\u00a0Display every active process on a Linux system in generic (Unix\/Linux) format.<\/p>\n<pre>$ ps -A\r\nOR\r\n$ ps -e\r\n<\/pre>\n<div id=\"attachment_27070\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27070\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Processes-in-Standard-Format.png\" alt=\"List Processes in Standard Format\" width=\"582\" height=\"268\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List Processes in Standard Format<\/p>\n<\/div>\n<p><strong>3.<\/strong>\u00a0Display all processes in\u00a0<strong>BSD<\/strong>\u00a0format.<\/p>\n<pre>$ ps au\r\nOR\r\n$ ps axu\r\n<\/pre>\n<div id=\"attachment_27071\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27071\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Processes-in-BSD-Format.png\" alt=\"List Processes in BSD Format\" width=\"672\" height=\"230\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List Processes in BSD Format<\/p>\n<\/div>\n<p><strong>4.<\/strong>\u00a0To perform a full-format listing, add the\u00a0<code>-f<\/code>\u00a0or\u00a0<code>-F<\/code>\u00a0flag.<\/p>\n<pre>$ ps -ef\r\nOR\r\n$ ps -eF\r\n<\/pre>\n<div id=\"attachment_27072\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27072\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Processes-in-Long-List-Format.png\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Processes-in-Long-List-Format.png 802w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Processes-in-Long-List-Format-768x220.png 768w\" alt=\"List Processes in Long List Format\" width=\"802\" height=\"230\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List Processes in Long List Format<\/p>\n<\/div>\n<h3>Display User Running Processes<\/h3>\n<p><strong>5.<\/strong>\u00a0You can select all processes owned by you (runner of the\u00a0<strong>ps command<\/strong>, root in this case), type:<\/p>\n<pre>$ ps -x \r\n<\/pre>\n<p><strong>6.<\/strong>\u00a0To display a user\u2019s processes by real user ID (<strong>RUID<\/strong>) or name, use the\u00a0<code>-U<\/code>\u00a0flag.<\/p>\n<pre>$ ps -fU tecmint\r\nOR\r\n$ ps -fu 1000\r\n<\/pre>\n<div id=\"attachment_27073\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27073\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-User-Processes-by-ID.png\" alt=\"List User Processes by ID\" width=\"722\" height=\"230\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List User Processes by ID<\/p>\n<\/div>\n<p><strong>7.<\/strong>\u00a0To select a user\u2019s processes by effective user\u00a0<strong>ID<\/strong>\u00a0(<strong>EUID<\/strong>) or name, use the\u00a0<code>-u<\/code>\u00a0option.<\/p>\n<pre>$ ps -fu tecmint\r\nOR\r\n$ ps -fu 1000\r\n<\/pre>\n<h3>Print All Processes Running as Root (Real and Effecitve ID)<\/h3>\n<p><strong>8.<\/strong>\u00a0The command below enables you to view every process running with\u00a0<strong>root<\/strong>\u00a0user privileges (real &amp; effective ID) in user format.<\/p>\n<pre>$ ps -U root -u root \r\n<\/pre>\n<div id=\"attachment_27074\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27074\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/Display-Running-Processes-of-Root-User.png\" alt=\"Display Root User Running Processes\" width=\"602\" height=\"230\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">Display Root User Running Processes<\/p>\n<\/div>\n<h3>Display Group Processes<\/h3>\n<p><strong>9.<\/strong>\u00a0If you want to list all processes owned by a certain group (real group ID (<strong>RGID<\/strong>) or name), type.<\/p>\n<pre>$ ps -fG apache\r\nOR\r\n$ ps -fG 48\r\n<\/pre>\n<div id=\"attachment_27075\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27075\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/Display-Group-Processes.png\" alt=\"Display Group Processes\" width=\"722\" height=\"306\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">Display Group Processes<\/p>\n<\/div>\n<p><strong>10.<\/strong>\u00a0To list all processes owned by effective group name (or session), type.<\/p>\n<pre>$ ps -fg apache\r\n<\/pre>\n<h3>Display Processes by PID and PPID<\/h3>\n<p><strong>11.<\/strong>\u00a0You can list processes by\u00a0<strong>PID<\/strong>\u00a0as follows.<\/p>\n<pre>$ ps -fp 1178\r\n<\/pre>\n<div id=\"attachment_27077\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27077\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Processes-by-PID.png\" alt=\"List Processes by PID\" width=\"742\" height=\"78\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List Processes by PID<\/p>\n<\/div>\n<p><strong>12.<\/strong>\u00a0To select process by\u00a0<strong>PPID<\/strong>, type.<\/p>\n<pre>$ ps -f --ppid 1154\r\n<\/pre>\n<div id=\"attachment_27078\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27078\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Process-by-PPID.png\" alt=\"List Process by PPID\" width=\"742\" height=\"78\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List Process by PPID<\/p>\n<\/div>\n<p><strong>13.<\/strong>\u00a0Make selection using\u00a0<strong>PID<\/strong>\u00a0list.<\/p>\n<pre>$ ps -fp 2226,1154,1146\r\n<\/pre>\n<div id=\"attachment_27079\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27079\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Processes-by-PIDs.png\" alt=\"List Processes by PIDs\" width=\"742\" height=\"116\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List Processes by PIDs<\/p>\n<\/div>\n<h3>Display Processes by TTY<\/h3>\n<p><strong>14.<\/strong>\u00a0To select processes by\u00a0<strong>tty<\/strong>, use the\u00a0<strong>-t<\/strong>\u00a0flag as follows.<\/p>\n<pre>$ ps -t pst\/0\r\n$ ps -t pst\/1\r\n$ ps -ft tty1\r\n<\/pre>\n<div id=\"attachment_27080\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27080\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Processes-by-TTY.png\" alt=\"List Processes by TTY\" width=\"742\" height=\"249\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List Processes by TTY<\/p>\n<\/div>\n<h3>Print Process Tree<\/h3>\n<p><strong>15.<\/strong>\u00a0A process tree shows how processes on the system are linked to each other; processes whose parents have been killed are adopted by the init (or systemd).<\/p>\n<pre>$ ps -e --forest \r\n<\/pre>\n<div id=\"attachment_27081\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27081\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Process-Tree.png\" alt=\"List Process Tree\" width=\"592\" height=\"591\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List Process Tree<\/p>\n<\/div>\n<p><strong>16.<\/strong>\u00a0You can also print a process tree for a given process like this.<\/p>\n<pre>$ ps -f --forest -C sshd\r\nOR\r\n$ ps -ef --forest | grep -v grep | grep sshd \r\n<\/pre>\n<div id=\"attachment_27082\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27082\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Tree-View-of-Process.png\" alt=\"List Tree View of Process\" width=\"722\" height=\"287\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List Tree View of Process<\/p>\n<\/div>\n<h3>Print Process Threads<\/h3>\n<p><strong>17.<\/strong>\u00a0To print all threads of a process, use the\u00a0<code>-H<\/code>\u00a0flag, this will show the\u00a0<strong>LWP<\/strong>\u00a0(<strong>light weight process<\/strong>) as well as\u00a0<strong>NLWP<\/strong>\u00a0(<strong>number of light weight process<\/strong>) columns.<\/p>\n<pre>$ ps -fL -C httpd\r\n<\/pre>\n<div id=\"attachment_27083\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27083\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Process-Threads.png\" sizes=\"auto, (max-width: 882px) 100vw, 882px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Process-Threads.png 882w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Process-Threads-768x151.png 768w\" alt=\"List Process Threads\" width=\"882\" height=\"173\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List Process Threads<\/p>\n<\/div>\n<h3>Specify Custom Output Format<\/h3>\n<p>Using the\u00a0<strong>-o<\/strong>\u00a0or\u00a0<strong>\u2013format<\/strong>\u00a0options, ps allows you to build user-defined output formats as shown below.<\/p>\n<p><strong>18.<\/strong>\u00a0To list all format specifiers, include the\u00a0<code>L<\/code>\u00a0flag.<\/p>\n<pre>$ ps L\r\n<\/pre>\n<p><strong>19.<\/strong>\u00a0The command below allows you to view the\u00a0<strong>PID<\/strong>,\u00a0<strong>PPID<\/strong>, user name and command of a process.<\/p>\n<pre>$ ps -eo pid,ppid,user,cmd\r\n<\/pre>\n<div id=\"attachment_27084\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27084\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Processes-with-Names.png\" alt=\"List Processes with Names\" width=\"692\" height=\"382\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List Processes with Names<\/p>\n<\/div>\n<p><strong>20.<\/strong>\u00a0Below is another example of a custom output format showing file system group, nice value, start time and elapsed time of a process.<\/p>\n<pre>$ ps -p 1154 -o pid,ppid,fgroup,ni,lstart,etime\r\n<\/pre>\n<div id=\"attachment_27085\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27085\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-Process-ID-Information.png\" alt=\"List Process ID Information\" width=\"692\" height=\"78\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List Process ID Information<\/p>\n<\/div>\n<p><strong>21.<\/strong>\u00a0To find a\u00a0<a href=\"https:\/\/www.tecmint.com\/find-process-name-pid-number-linux\/\" target=\"_blank\" rel=\"noopener\">process name using its PID<\/a>.<\/p>\n<pre>$ ps -p 1154 -o comm=\r\n<\/pre>\n<div id=\"attachment_27086\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27086\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/Find-Process-using-PID.png\" alt=\"Find Process using PID\" width=\"432\" height=\"59\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">Find Process using PID<\/p>\n<\/div>\n<h3>Display Parent and Child Processes<\/h3>\n<p><strong>22.<\/strong>\u00a0To select a specific process by its name, use the -C flag, this will also display all its child processes.<\/p>\n<pre>$ ps -C sshd\r\n<\/pre>\n<div id=\"attachment_27087\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27087\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/Find-Parent-Child-Process.png\" alt=\"Find Parent Child Process\" width=\"432\" height=\"135\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">Find Parent Child Process<\/p>\n<\/div>\n<p><strong>23.<\/strong>\u00a0Find all\u00a0<strong>PIDs<\/strong>\u00a0of all instances of a process, useful when writing scripts that need to read\u00a0<strong>PIDs<\/strong>\u00a0from a std output or file.<\/p>\n<pre>$ ps -C httpd -o pid=\r\n<\/pre>\n<div id=\"attachment_27088\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27088\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/Find-All-Process-PIDs.png\" alt=\"Find All Process PIDs\" width=\"432\" height=\"154\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">Find All Process PIDs<\/p>\n<\/div>\n<p><strong>24.<\/strong>\u00a0Check execution time of a process.<\/p>\n<pre>$ ps -eo comm,etime,user | grep httpd\r\n<\/pre>\n<p>The output below shows the HTTPD service has been running for 1 hours, 48 minutes and 17 seconds.<\/p>\n<div id=\"attachment_27089\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27089\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/Find-Process-Uptime.png\" alt=\"Find Process Uptime\" width=\"582\" height=\"154\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">Find Process Uptime<\/p>\n<\/div>\n<h3>Troubleshoot Linux System Performance<\/h3>\n<p>If your system isn\u2019t working as it should be, for instance if it\u2019s unusually slow, you can\u00a0<a href=\"https:\/\/www.tecmint.com\/linux-system-monitoring-troubleshooting-tools\/\" target=\"_blank\" rel=\"noopener\">perform some system troubleshooting<\/a>\u00a0as follows.<\/p>\n<p><strong>26.<\/strong>\u00a0Find\u00a0<a href=\"https:\/\/www.tecmint.com\/find-linux-processes-memory-ram-cpu-usage\/\" target=\"_blank\" rel=\"noopener\">top running processes<\/a>\u00a0by highest memory and CPU usage in Linux.<\/p>\n<pre>$ ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head\r\nOR\r\n$ ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%cpu | head\r\n<\/pre>\n<div id=\"attachment_27090\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27090\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/Find-Top-Running-Processes.png\" alt=\"Find Top Running Processes\" width=\"702\" height=\"230\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">Find Top Running Processes<\/p>\n<\/div>\n<p><strong>27.<\/strong>\u00a0To kill an Linux\u00a0<a href=\"https:\/\/www.tecmint.com\/kill-processes-unresponsive-programs-in-ubuntu\/\" target=\"_blank\" rel=\"noopener\">processes\/unresponsive applications<\/a>\u00a0or any process that is consuming high CPU time.<\/p>\n<p>First, find the\u00a0<strong>PID<\/strong>\u00a0of the unresponsive process or application.<\/p>\n<pre>$ ps -A | grep -i stress\r\n<\/pre>\n<p>Then use the\u00a0<a href=\"https:\/\/www.tecmint.com\/how-to-kill-a-process-in-linux\/\" target=\"_blank\" rel=\"noopener\">kill command<\/a>\u00a0to terminate it immediately.<\/p>\n<pre>$ kill -9 2583 2584\r\n<\/pre>\n<div id=\"attachment_27091\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27091\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/Find-Kill-a-Process.png\" alt=\"Find and Kill a Process\" width=\"532\" height=\"154\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">Find and Kill a Process<\/p>\n<\/div>\n<h3>Print Security Information<\/h3>\n<p><strong>28.<\/strong>\u00a0Show security context (specifically for\u00a0<strong>SELinux<\/strong>) like this.<\/p>\n<pre>$ ps -eM\r\nOR\r\n$ ps --context\r\n<\/pre>\n<div id=\"attachment_27092\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27092\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/Find-SELinux-Context.png\" alt=\"Find SELinux Context\" width=\"752\" height=\"268\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">Find SELinux Context<\/p>\n<\/div>\n<p><strong>29.<\/strong>\u00a0You can also display security information in user-defined format with this command.<\/p>\n<pre>$ ps -eo  euser,ruser,suser,fuser,f,comm,label\r\n<\/pre>\n<div id=\"attachment_27093\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27093\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-SELinux-Context-by-Users.png\" sizes=\"auto, (max-width: 872px) 100vw, 872px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-SELinux-Context-by-Users.png 872w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/List-SELinux-Context-by-Users-768x236.png 768w\" alt=\"List SELinux Context by Users\" width=\"872\" height=\"268\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">List SELinux Context by Users<\/p>\n<\/div>\n<h3>Perform Real-time Process Monitoring Using Watch Utility<\/h3>\n<p><strong>30.<\/strong>\u00a0Finally, since\u00a0<strong>ps<\/strong>\u00a0displays static information, you can employ the\u00a0<a href=\"https:\/\/www.tecmint.com\/fswatch-monitors-files-and-directory-changes-modifications-in-linux\/\" target=\"_blank\" rel=\"noopener\">watch utility<\/a>\u00a0to perform real-time process monitoring with repetitive output, displayed after every second as in the command below (specify a custom\u00a0<strong>ps command<\/strong>\u00a0to achieve your objective).<\/p>\n<pre>$ watch -n 1 'ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head'\r\n<\/pre>\n<div id=\"attachment_27094\" class=\"wp-caption aligncenter\">\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-27094\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/Real-Time-Processes-Monitoring.png\" sizes=\"auto, (max-width: 872px) 100vw, 872px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/Real-Time-Processes-Monitoring.png 872w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2017\/09\/Real-Time-Processes-Monitoring-768x236.png 768w\" alt=\"Real Time Process Monitoring\" width=\"872\" height=\"268\" data-lazy-loaded=\"true\" \/><\/p>\n<p class=\"wp-caption-text\">Real Time Process Monitoring<\/p>\n<\/div>\n<p><strong>Important<\/strong>: ps only shows static information, to view frequently updated output you can use tools such as\u00a0<a href=\"https:\/\/www.tecmint.com\/install-htop-linux-process-monitoring-for-rhel-centos-fedora\/\" target=\"_blank\" rel=\"noopener\">htop<\/a>;\u00a0<a href=\"https:\/\/www.tecmint.com\/12-top-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">top<\/a>\u00a0and\u00a0<a href=\"https:\/\/www.tecmint.com\/glances-an-advanced-real-time-system-monitoring-tool-for-linux\/\" target=\"_blank\" rel=\"noopener\">glances<\/a>: the last two are in fact Linux system performance monitoring tool.<\/p>\n<p>You might also like to read these following related articles.<\/p>\n<ol>\n<li><a href=\"https:\/\/www.tecmint.com\/find-process-name-pid-number-linux\/\" target=\"_blank\" rel=\"noopener\">How to Find a Process Name Using PID Number in Linux<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/find-linux-processes-memory-ram-cpu-usage\/\" target=\"_blank\" rel=\"noopener\">Find Top Running Processes by Highest Memory and CPU Usage in Linux<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/how-to-kill-a-process-in-linux\/\" target=\"_blank\" rel=\"noopener\">A Guide to Kill, Pkill and Killall Commands to Terminate a Process in Linux<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/find-and-kill-running-processes-pid-in-linux\/\" target=\"_blank\" rel=\"noopener\">How to Find and Kill Running Processes in Linux<\/a><\/li>\n<li><a href=\"https:\/\/www.tecmint.com\/run-linux-command-process-in-background-detach-process\/\" target=\"_blank\" rel=\"noopener\">How to Start Linux Command in Background and Detach Process in Terminal<\/a><\/li>\n<\/ol>\n<p>That\u2019s all for now. If you have any useful\u00a0<strong>ps command<\/strong>\u00a0example(s) to share (not forgetting to explain what it does), use the comment form below.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/ps-command-examples-for-linux-process-monitoring\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ps\u00a0(processes status) is a native Unix\/Linux utility for viewing information concerning a selection of running processes on a system: it reads this information from the virtual files in\u00a0\/proc filesystem. It is one of the important utilities for system administration specifically under process monitoring, to help you understand whats is going on a Linux system. It &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/13\/30-useful-ps-command-examples-for-linux-process-monitoring\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;30 Useful \u2018ps Command\u2019 Examples for Linux Process Monitoring&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11308","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11308","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=11308"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11308\/revisions"}],"predecessor-version":[{"id":11309,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11308\/revisions\/11309"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=11308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=11308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=11308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}