0
0
Linux CLIscripting~5 mins

ps (list processes) in Linux CLI - Commands & Configuration

Choose your learning style9 modes available
Introduction
Sometimes you want to see what programs are running on your computer. The ps command shows you a list of these running programs, called processes. This helps you understand what your computer is doing right now.
When you want to check if a program you started is still running.
When your computer feels slow and you want to see which programs use resources.
When you want to find the process ID (PID) to stop a program.
When you want to see all running programs by all users on the system.
When you want to check details like how long a program has been running.
Commands
This command shows the processes running in the current terminal session. It helps you see what you started in this window.
Terminal
ps
Expected OutputExpected
PID TTY TIME CMD 1234 pts/0 00:00:00 bash 5678 pts/0 00:00:01 ps
This command shows all running processes on the system from all users with detailed information. It helps you see everything running on your computer.
Terminal
ps aux
Expected OutputExpected
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1 0.0 0.1 169084 5404 ? Ss 10:00 0:01 /sbin/init user 1234 0.1 0.3 275432 12340 pts/0 Ss 10:05 0:00 bash user 5678 0.0 0.1 46232 3456 pts/0 R+ 10:06 0:00 ps aux
a - Show processes of all users, not just yours
u - Display user-oriented format with details
x - Include processes without a controlling terminal
This command lists all processes in a full-format listing. It is another common way to see all running processes with details.
Terminal
ps -ef
Expected OutputExpected
UID PID PPID C STIME TTY TIME CMD root 1 0 0 10:00 ? 00:00:01 /sbin/init user 1234 1200 0 10:05 pts/0 00:00:00 bash user 5678 1234 0 10:06 pts/0 00:00:00 ps -ef
-e - Show all processes
-f - Show full format listing
Key Concept

If you remember nothing else from ps, remember: it shows you what programs are running and their details so you can manage your computer better.

Common Mistakes
Running ps without flags expecting to see all processes.
By default, ps shows only processes in the current terminal session, so you miss other running programs.
Use ps aux or ps -ef to see all running processes on the system.
Confusing the output columns and not knowing which PID to use.
Without understanding the columns, you might pick the wrong process to stop or monitor.
Learn the meaning of columns like PID (process ID), USER (owner), and COMMAND (program name) before acting.
Summary
ps shows running programs (processes) on your computer.
Use ps aux or ps -ef to see all processes with details.
Knowing the process ID helps you manage or stop programs.