{"id":18339,"date":"2022-09-05T12:07:47","date_gmt":"2022-09-05T12:07:47","guid":{"rendered":"https:\/\/linuxways.net\/?p=18339"},"modified":"2022-09-21T10:04:01","modified_gmt":"2022-09-21T10:04:01","slug":"ps-command-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/linux-commands\/ps-command-linux\/","title":{"rendered":"PS Command Linux"},"content":{"rendered":"<p>\u201cThe process status or the PS command in Linux is used for displaying the status of the different processes of a system. It includes the nature of these processes, their time of execution, PIDs, etc. However, the output of this command can easily be customized according to the needs by using the different options that are available. Therefore, in this article, we will be sharing with you a few examples of using the PS command in Linux.\u201d<\/p>\n<h2><strong>Using the PS Command in Linux<\/strong><\/h2>\n<p>Before starting to use the process status command in Linux, we would like you to take a look at its help manual so that you can have an idea about the different options that we will be using in the examples below. The following command will help you in accessing the help manual of this command:<\/p>\n<pre>\r\n$ ps --help s\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"326\" height=\"25\" class=\"wp-image-18352\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-1.png 326w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-1-300x23.png 300w\" sizes=\"auto, (max-width: 326px) 100vw, 326px\" \/><\/strong><\/p>\n<p>The help manual of the PS command in its simplest form is shown in the image below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"546\" height=\"298\" class=\"wp-image-18356\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-2.png 546w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-2-300x164.png 300w\" sizes=\"auto, (max-width: 546px) 100vw, 546px\" \/><\/p>\n<p>Now, we will walk you through some of the different usage scenarios of this command.<\/p>\n<h2><strong>Example # 1: Using the PS Command Without Any Options<\/strong><\/h2>\n<p>You can use the PS command independently, i.e., without any options. In this way, this command only displays the processes belonging to the current terminal. This command can be executed in the following manner:<\/p>\n<pre>\r\n$ ps\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"254\" height=\"25\" class=\"wp-image-18359\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-3.png\" \/><\/strong><\/p>\n<p>The processes belonging to our current terminal are shown in the image below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"297\" height=\"101\" class=\"wp-image-18362\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-4.png\" \/><\/p>\n<h2><strong>Example # 2: Using the PS Command With the \u201c-A\u201d Option<\/strong><\/h2>\n<p>If you want to list down all the processes of your system, then you should use the PS command in the following manner:<\/p>\n<pre>\r\n$ ps \u2013A\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"279\" height=\"28\" class=\"wp-image-18369\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-5.png\" \/><\/strong><\/p>\n<p>The \u201c-A\u201d flag allows you to display all the processes on the terminal, as shown in the image below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"519\" height=\"411\" class=\"wp-image-18380\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-6.png 519w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-6-300x238.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-6-150x120.png 150w\" sizes=\"auto, (max-width: 519px) 100vw, 519px\" \/><\/p>\n<h2><strong>Example # 3: Using the PS Command With the \u201c-d\u201d Option<\/strong><\/h2>\n<p>If you wish to display all the processes except for the session leaders, then you can execute the PS command as follows:<\/p>\n<pre>\r\n$ ps \u2013d\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"271\" height=\"24\" class=\"wp-image-18383\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-7.png\" \/><\/strong><\/p>\n<p>All the processes of our system, except for the session leaders, are shown in the image below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"537\" height=\"410\" class=\"wp-image-18388\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-8.png 537w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-8-300x229.png 300w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/p>\n<h2><strong>Example # 4: Using the PS Command With the \u201cr\u201d Option<\/strong><\/h2>\n<p>Now, if you only wish to display the running processes on the terminal, then you will have to use the PS command as follows:<\/p>\n<pre>\r\n$ ps r\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"268\" height=\"25\" class=\"wp-image-18390\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-9.png\" \/><\/strong><\/p>\n<p>All the running processes of our Linux system are displayed in the image below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"341\" height=\"74\" class=\"wp-image-18392\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-10.png 341w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-10-300x65.png 300w\" sizes=\"auto, (max-width: 341px) 100vw, 341px\" \/><\/p>\n<h2><strong>Example # 5: Using the PS Command With the \u201cT\u201d Option<\/strong><\/h2>\n<p>This method is an alternative to the first method that we discussed for displaying the processes belonging to the current terminal only. You just need to run the PS command in the following manner:<\/p>\n<pre>\r\n$ ps T\r\n<\/pre>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"270\" height=\"26\" class=\"wp-image-18393\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-11.png\" \/><\/strong><\/p>\n<p>The \u201cT\u201d flag of the PS command restricts the output of this command to the processes belonging only to the current terminal, as shown in the image below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"319\" height=\"96\" class=\"wp-image-18396\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-12.png 319w, https:\/\/linuxways.net\/wp-content\/uploads\/2022\/08\/word-image-18339-12-300x90.png 300w\" sizes=\"auto, (max-width: 319px) 100vw, 319px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>We talked about the purpose of the PS command in this article, followed by a few examples to elaborate on its usage. Once you understand these examples well, it will be very easy for you to use the PS command on your Linux system.<\/p>","protected":false},"excerpt":{"rendered":"<p>This article explains that the process status or the PS command in Linux is used for displaying the status of the different processes of a system.<\/p>","protected":false},"author":3,"featured_media":18436,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1049],"tags":[],"class_list":["post-18339","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-commands"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/18339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=18339"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/18339\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/18436"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=18339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=18339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=18339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}