How to View Running Processes Using the ps Command in Linux

When you are managing a Linux server, you do not have a graphical Task Manager to show you which applications are currently running. If a Python script has frozen in the background, or a web server process is consuming too many resources, you must rely on the command line to identify the exact process ID (PID) before you can forcefully terminate it.

The ps (Process Status) command is the core utility used by system administrators to take a snapshot of every single program, script, and background daemon actively executing on the system.

The Basic ‘ps’ Command

If you open your terminal and simply type the command by itself:

ps

You will likely be underwhelmed by the results. The basic ps command only displays the processes that are actively running in your current terminal session. It will usually only list two things: the bash shell you are typing in, and the ps command you just executed.

To see the processes running across the entire operating system, you must use command flags.

How to View Every Running Process (ps aux)

The most common and most powerful combination of flags used by Linux administrators is aux. This combination strips away user restrictions and displays a highly detailed, comprehensive list of everything happening on the server.

Type the following command and press Enter:

ps aux

Your terminal will instantly flood with hundreds of lines of output. Here is what the columns mean:

  • USER: The system account (e.g., root, www-data, or your username) that owns and launched the process.
  • PID: The Process ID. This is a unique number assigned to the application. If you need to kill a frozen app, this is the number you must use (e.g., kill 1234).
  • %CPU and %MEM: The exact percentage of processing power and RAM the application is currently consuming.
  • START and TIME: When the application was launched, and how much total CPU time it has accumulated.
  • COMMAND: The actual name of the program or script that is running (e.g., /usr/sbin/nginx or python3 main.py).

How to Search for a Specific Process

Because ps aux outputs hundreds of background system processes, manually scrolling through the list to find a specific application is highly inefficient.

To find exactly what you are looking for, you can pipe the output of the ps command directly into the grep search tool. For example, if you want to find all running instances of the Apache web server, you would type:

ps aux | grep apache2

The terminal will filter out the noise and only print the rows containing the word “apache2”, allowing you to instantly identify the PID of the web server.

How to View a Process Tree (pstree)

Sometimes, a single application spawns dozens of smaller “child” processes. Looking at a flat list makes it difficult to understand which process is in charge.

To view processes hierarchically, use the pstree command instead:

pstree

This command outputs a visual, branching tree diagram. It clearly demonstrates how the main operating system spawned a background service, which in turn spawned your specific application, making complex server debugging much easier to visualize.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.