Introduction to Processes: A Linux Guide for Developers
Master Linux processes by learning to use the ps command, identifying PIDs, and understanding parent/child relationships to manage your server effectively.

Previously in this course, we covered Understanding Users and Groups in Linux: A Developer's Guide, where we learned how the system identifies who is executing commands. In this lesson, we shift our focus from the who to the what: how the Linux kernel executes and tracks the programs running on your server.
Understanding Processes from First Principles
In Linux, a "process" is simply an instance of a running program. When you execute a command, the kernel allocates memory, CPU time, and resources to that specific execution. Every process is tracked by the kernel using a unique identifier called a Process ID (PID).
Processes exist in a hierarchy. Every process is spawned by another process, known as the Parent Process. The very first process started by the Linux kernel when the system boots is init (or systemd), which carries the PID 1. Every other process on your system is a descendant of this initial process.
Understanding this tree structure is vital when you start managing services, as killing a parent process often terminates all of its children—a common scenario when debugging our web server.
Inspecting System Activity with ps
The primary tool for viewing these processes is ps (Process Status). While you can run ps by itself, it is most useful with flags that provide a comprehensive view of the system.
A standard, highly informative command is ps aux:
a: Shows processes for all users.u: Displays the process's user/owner.x: Includes processes that aren't attached to a terminal (like background services).
Worked Example: Analyzing Running Processes
Let’s look at how to interpret this output. Open your terminal and run:
Bashps aux | head -n 5
You will see columns similar to these:
| USER | PID | %CPU | %MEM | COMMAND |
|---|---|---|---|---|
| root | 1 | 0.0 | 0.1 | /sbin/init |
| root | 452 | 0.0 | 0.2 | /lib/systemd/systemd-journald |
| user | 1204 | 0.1 | 0.5 | -bash |
- USER: The user account running the process.
- PID: The unique ID used to identify and manage the process.
- COMMAND: The actual executable running.
If you want to see the parent/child relationship specifically, you can use ps -ef. The PPID column represents the "Parent Process ID." You can trace how your shell (bash) was started by a terminal emulator or an SSH session by looking at its PPID.
Hands-on Exercise: Tracking Your Web Server
In our ongoing project, we need to ensure our server environment is clean. Let's practice identifying the processes currently running in your user session.
- Open two terminal windows.
- In the first window, run
sleep 100. This creates a simple process that does nothing but wait. - In the second window, find the PID of your
sleepcommand:Bashps aux | grep sleep - Note the PID. Now, look at your shell process:
Compare the PPID of theBashps -fsleepcommand to the PID of your shell. You will see they are linked!
Common Pitfalls
- Confusing UID and PID: Remember that User IDs (UIDs) identify users, while PIDs identify instances of programs.
- Ignoring Background Processes: Many processes run in the background without a terminal attached. Using
ps auxensures you don't miss these; using justpswill often only show the processes tied to your current session. - Zombies: Sometimes you will see a process labeled
<defunct>. This is a "zombie" process—it has finished execution but is waiting for its parent to acknowledge it. They don't consume CPU, but they do hold onto a PID entry in the kernel table.
FAQ
What happens if I kill PID 1?
On most modern Linux systems, systemd (PID 1) is protected. The kernel will refuse to kill it, as doing so would cause an immediate system panic (crash).
Why do I see the same command listed multiple times? Many modern applications, including web servers like Nginx or Apache, spawn multiple "worker processes" to handle concurrent requests. Each worker gets its own PID, even if they all belong to the same program.
Is ps real-time?
No. ps provides a snapshot of the system at the exact moment you ran the command. For a live, updating view, we will explore top in the next lesson.
Recap
We have established that Linux manages programs as processes, each assigned a unique PID. We explored how to use ps aux to list these processes and identified the hierarchical nature of parent and child processes. Mastering these basics is the foundation for managing the services and web server configurations we will build throughout the rest of this course.
Up next: Real-time Monitoring with Top
Work with me

VPS Server Setup, Deployment & Hardening
Get your app live on a fast, secure server — properly configured, hardened, and deployment-ready. No more wrestling with the command line.

Custom Email & File Storage System on Cloudflare (Google Workspace Alternative)
Your own private email + file storage suite on your domain — unlimited mailboxes, no per-seat fees. A self-owned Google Workspace alternative for a flat ~$5/month.


