How to List All Running Processes in Ubuntu?
Managing system performance and troubleshooting frozen applications
in Ubuntu requires knowing how to view active tasks. This article
provides a quick guide on the primary terminal commands used to list all
running processes, including the standard ps command, the
real-time top and htop monitors, and methods
for filtering specific applications. Whether you need a static snapshot
or an interactive dashboard, these tools will help you monitor your
system efficiently.
The Standard Method: The
ps Command
The most common way to view processes in Ubuntu is the
ps (process status) command. By default, running
ps only shows processes tied to the current terminal
session. To list every single active process on the system, you need to
use specific flags.
ps -ef: This command lists all running processes in a standard format. The-eflag selects all processes, and-fprovides a full-length listing with detailed columns.ps aux: This is a highly popular BSD-style alternative.ashows processes for all users.udisplays the user/owner column and detailed resource usage (CPU and memory).xincludes processes that are not attached to a terminal (such as background daemons).
Interactive
Real-Time Monitoring: top and htop
If you need to monitor system resources dynamically rather than viewing a static snapshot, interactive terminal utilities are the best choice.
The Standard top
Command
Every Ubuntu system comes pre-installed with top.
Running top in your terminal opens a live-updating list of
processes sorted automatically by CPU usage. It also displays overall
system health, such as uptime, tasks total, and current memory
utilization. You can exit this view by pressing Q.
The Enhanced htop
Utility
While top works perfectly, htop is a much
more user-friendly, color-coded alternative. It allows you to scroll
vertically and horizontally, and even kill processes directly using your
mouse or function keys. If it is not already installed, you can get it
by running:
sudo apt update && sudo apt install htopOnce installed, simply type htop to launch the
interactive dashboard.
Finding Specific Processes
When dealing with hundreds of background tasks, scrolling through a massive list is inefficient. You can pinpoint specific applications using targeted commands.
- Using grep with ps: You can pipe the output of
psintogrepto filter for a specific application name. For example, to find any running instances of Firefox, use:
ps aux | grep firefox- The
pgrepCommand: If you only need the Process ID (PID) of a specific application to terminate it, you can bypass the main list entirely by usingpgrep:
pgrep firefox