How to List Processes in Linux: Simple Commands Explained
To list processes in Linux, use the
ps command for a snapshot of current processes or top to see a live updating list. For detailed info, ps aux shows all running processes with user and resource usage.Syntax
The basic commands to list processes are:
ps: Shows processes running in the current shell.ps aux: Lists all processes with detailed info.top: Displays a live, updating list of processes.
Each part means:
ps: process status command.a: show processes of all users.u: display user-oriented format.x: include processes without a controlling terminal.
bash
ps aux top
Example
This example uses ps aux to list all running processes with details like user, CPU and memory usage, and command name.
bash
ps aux
Output
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.1 169084 5644 ? Ss 10:00 0:01 /sbin/init
user 2345 0.1 0.3 245000 12340 ? Sl 10:05 0:10 /usr/bin/python3 script.py
user 5678 0.0 0.2 150000 8000 pts/0 R+ 10:10 0:00 top
Common Pitfalls
Common mistakes when listing processes include:
- Running
pswithout options shows only processes in the current shell, missing others. - Using
topwithout understanding its interactive commands can confuse beginners. - Not having proper permissions may hide some processes.
Always use ps aux for a full list and run commands with appropriate permissions.
bash
ps # This shows limited processes ps aux # This shows all processes with details
Quick Reference
| Command | Description |
|---|---|
| ps | Show processes in current shell |
| ps aux | Show all processes with detailed info |
| top | Show live updating process list |
| htop | Interactive process viewer (if installed) |
Key Takeaways
Use
ps aux to see all running processes with details.Use
top for a live, updating view of processes.Running
ps without options shows only current shell processes.Some processes may require root permissions to view.
Use
htop if you want an easier interactive process viewer.