Linux command: PS (Process Status)

An overview of the Linux “ps” command

Md Shamim
Geek Culture
3 min readNov 10, 2022

--

From: https://wizardzines.com/comics/ps/

ps — Process Status

ps command displays information related to the processes running in a Linux system.

PID — Unique process ID
TTY — Type of terminal that the user is currently logged in.
TIME — CPU time this process has consumed since it first started running. CMD — The command used to start the corresponding process.

ps with Arguments

If we pass arguments with a (-) dash then we will get the output in standard syntax. In contrast, if we pass arguments without any (-) dash then we will get output in BSD (Berkeley Software Distribution) syntax.

To view all running processes : ps -e or ps -A
To view full formated list of all running processes:
ps -efL

We can use grep along with ps command to search for a specific process;
Let’s say we want to see our “httpd” server is running or not. We can do that in the following way:

To view all running processes by username and group:

To view the process tree. Within a process there can be multiple processes running, we can use ps -ejH to view the process tree:

In the above demonstration, we can see the process tree of the “sshd” process.

The most widely used ps command is ps aux : which will output all the running processes using the BSD syntax. The ps aux displays the most amount of information a user usually needs to understand the current state of their systems running processes.

ps aux provides additional information, such as :

%CPU CPU time used by this process (in percentage)

%MEM Physical memory used by this process (in percentage)

VSZ displays the amount of virtual memory being consumed by the process.

RSS is the actual physical wired-in memory that is being used.

START shows the date or time when the process was started.

TIME shows the total CPU time used by this process.

STAT displays the state of a process. The most common state codes are described below:

R: Running or runnable.
S: Interruptible sleep, waiting for an event to complete, such as input from
the terminal.
D: Uninterruptible sleep, processes that cannot be killed or interrupted with a signal, usually to make them go away you have to reboot or fix the issue.
Z: Zombies are terminated processes that are waiting to have their statuses collected.
T: Stopped, a process that has been suspended/stopped.

If you found this article helpful, please don’t forget to hit the Follow and Clap buttons to help me write more articles like this.
Thank You 🖤

--

--

Md Shamim
Geek Culture

Cloud Infrastructure Engineer | AWS Community Builder | AWS | Kubernetes | GitHub Actions | Terraform | 👇👉 linkedin.com/in/shamimice03 github.com/shamimice03