Linux from Zero #2 Processes: what's actually running under your terminal
Part 2 of the "Linux from Zero" series. If you haven't read #1 yet, it's on Medium and DEV.to — start there to understand the approach: investigate through evidence, not by memorizing commands. The problem nobody explains properly Have you ever run ps aux and watched a huge list of lines scroll by, without really knowing what to do with it? Most tutorials teach you the command, but not how to…
In this continuation of the Linux from Zero series, the author emphasizes understanding the output of the ps command to gain insight into what processes are running on a system. To demonstrate, the author opens two terminals side by side. In the first terminal, they run the command "sleep 300 &," which creates a process that sleeps for 300 seconds.
In the second terminal, they use the command "ps -eo pid,ppid,stat,etime,cmd | grep sleep," which outputs a line containing process information, such as PID (Process ID), PPID (Parent Process ID), STAT (state), ELAPSED (elapsed time), and CMD (command).
The author explains the significance of each column, including PID, which is a unique identifier for the process; PPID, which indicates the parent process; STAT, which reveals the current state of the process, such as sleeping, running, zombie, or uninterruptible I/O wait; ELAPSED, which shows how long the process has been running; and CMD, which displays the command used to start the process.
Understanding these columns is crucial for diagnosing issues in a production environment. For example, a process stuck in D state (uninterruptible sleep) often indicates a disk or storage problem rather than an application bug. The author also explains that killing a process through its parent (using "kill -TERM [parent PID]") typically results in the parent killing its child process as well.
This concept demonstrates how the parent-child relationship between processes plays a foundational role in Linux for isolating processes into namespaces, which later leads to the creation of containers and the orchestration of those containers using Kubernetes.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.