In Linux/Unix, every running program or command is driven by a process, acting as the core of system operations. Whether you’re coding in a text editor, executing a complex script, or surfing the web, processes make it all possible. Understanding the basics of processes is essential for effectively managing your Linux/Unix system and harnessing its full capabilities.
This guide explains what processes are, how they work, and the tools you can use to manage them.
Table of Contents
- What is a Process?
- Types of Processes in Linux/Unix
- Life Cycle of a Process
- Key Terms to Know
- Process Management Commands
- Signals in Linux/Unix
- Example: Managing Processes
- Conclusion
What is a Process?
A process is a program in execution. It has:
- Program Code: The instructions to run.
- Runtime Data: Temporary data used while running.
For example, when you open a text editor, a process is created to manage its execution.
Types of Processes in Linux/Unix
- Foreground Processes
- Run in the terminal and take user input.
- Example: Opening a text editor like
nano
.
- Background Processes
- Run in the background, independent of user input.
- Example: System updates or daemons like
cron
.
- Daemon Processes
- Special background processes that start during system boot.
- Example:
httpd
(web server process).
- Zombie Processes
- Processes that have finished execution but still occupy a slot in the process table.
- Orphan Processes
- Processes whose parent has terminated.
Life Cycle of a Process
A process in Linux/Unix has a life cycle with the following stages:
- Created: The process is created with a unique Process ID (PID).
- Ready: It’s waiting for CPU time to execute.
- Running: Actively using the CPU.
- Terminated: The process has finished or been stopped.
Key Terms to Know
- PID (Process ID): A unique number assigned to each process.
- Parent Process: A process that creates another process.
- Child Process: A process created by a parent process.
- PPID (Parent Process ID): The PID of a parent process.
Process Management Commands
- Viewing Processes
ps
: Lists active processes.top
: Displays real-time process information.htop
: A more user-friendly version oftop
.
- Killing Processes
kill [PID]
: Stops a process using its PID.killall [name]
: Stops all processes with a specific name.
- Running Processes in Background
- Add
&
after a command.
- Add

4. Bringing Background Processes to Foreground
fg
: Resumes a background process in the foreground.

Changing Process Priority
nice -n [priority] [command]
: Starts a process with a priority.renice [priority] [PID]
: Changes the priority of an existing process.
Signals in Linux/Unix
Signals are ways to communicate with processes. Common signals:
SIGKILL
: Forcefully stops a process.SIGTERM
: Politely asks a process to stop.SIGSTOP
: Pauses a process.SIGCONT
: Resumes a paused process.
Example of sending a signal:
kill -SIGKILL [PID]
Example: Managing a Background Process
- Check its PID:

Stop the process:

Conclusion
Processes are at the core of Linux/Unix operations. By understanding how to view, manage, and terminate processes, you can keep your system running smoothly. Tools like ps
, top
, and kill
are your go-to helpers for mastering process management.