In Linux, everything running on the system is a process. Whether it’s a system service, background daemon, or user application, each runs in its own virtual address space.
Since Linux is a multitasking operating system, multiple processes run simultaneously. Understanding how to monitor and manage these processes is a core skill for Linux administrators.
This guide explains:
- What a process is in Linux
- Types of Linux processes
- Process state codes (R, S, Z, D, T)
- How to use the ps command
- How to interpret ps aux output
What Is a Process in Linux?
A process is a running instance of a program.
When you execute a command, Linux:
- Allocates memory
- Assigns a Process ID (PID)
- Creates a virtual address space
- Schedules CPU time
Every active task in Linux – including system services operates as a process.
Types of Processes in Linux
Linux systems run several categories of processes:
1. Interactive Processes
- Started from a terminal (shell)
- Can run in foreground or background
- Controlled by the user
Example:
firefox & 2. Batch Processes
- Not linked to a terminal
- Executed automatically from a queue
- Often scheduled via cron
3. Daemon Processes
- Background services
- Start during system boot
- Run continuously
Examples:
- sshd
- cron
- systemd
Daemons typically have no associated terminal (TTY shows ?).
Linux Process States (STAT Codes Explained)
When using the ps command, the STAT column shows process state codes.
| Code | Meaning |
| R | Running or ready to run |
| S | Interruptible sleep (waiting for event) |
| D | Uninterruptible sleep (usually I/O wait) |
| T | Stopped (job control or tracing) |
| Z | Zombie (defunct process) |
| X | Dead (rarely seen) |
Key States Explained
R – Running
The process is currently executing or ready for CPU scheduling.
S – Sleeping
The process is idle, waiting for an event or signal.
D – Uninterruptible Sleep
Usually waiting on disk I/O. Cannot be interrupted by signals.
Z – Zombie Process
The process has finished execution but still exists in the process table because its parent hasn’t collected its exit status.
Understanding the Linux ps Command
The ps (process status) command displays information about active processes.
Basic Usage
ps Shows processes associated with the current terminal session.
View All Processes
ps aux This is the most commonly used form.
Understanding ps aux Output
Example:
ps aux Output columns include:
| Column | Description |
| USER | Process owner |
| PID | Process ID |
| %CPU | CPU usage |
| %MEM | Memory usage |
| VSZ | Virtual memory size |
| RSS | Resident memory size |
| TTY | Terminal associated |
| STAT | Process state |
| START | Start time |
| TIME | CPU time consumed |
| COMMAND | Executed command |
What Is a PID?
A PID (Process ID) is a unique number assigned to each process.
- Starts at 1 (usually init or systemd)
- Increments sequentially
- Reused after reaching system limit
To terminate a process:
kill PID Example:
kill 1234 Understanding TTY Column
- Displays terminal from which process started
- ? indicates daemon/background process
- Useful for identifying interactive sessions
What Is CPU TIME in ps Output?
The TIME column shows:
Total CPU time used by the process
This is NOT the total runtime duration – only CPU usage time.
Login Shell Identification
Login shells often appear with a hyphen:
Example:
-bash This indicates the original login shell.
Additional shells started afterward will not have the hyphen.
Common Linux Process Management Commands
| Command | Purpose |
| ps | View running processes |
| top | Real-time process monitoring |
| htop | Enhanced process viewer |
| kill | Terminate process |
| kill -9 | Force kill process |
| nice | Set process priority |
| renice | Modify priority of running process |
When to Use ps Command
System administrators use ps to:
- Identify high CPU processes
- Detect zombie processes
- Monitor daemon activity
- Troubleshoot stuck tasks
- Investigate system performance
Summary
The Linux ps command is a fundamental tool for:
- Monitoring running processes
- Understanding process states
- Managing system resources
- Troubleshooting performance issues
By understanding PID, STAT codes, and process types, administrators can efficiently manage Linux systems.
If you’re managing production Linux servers and need expert assistance with process management, performance tuning, or troubleshooting, professional Linux server support can help maintain system stability and uptime.
If you require help, contact SupportPRO Server Admin
Partner with SupportPRO for 24/7 proactive cloud support that keeps your business secure, scalable, and ahead of the curve.
