Processes represent the running programs and tasks on a Linux system. Every action in Linux—opening a browser, running a command, or executing a script—creates a process.
For cybersecurity professionals and system administrators, monitoring processes helps detect malicious programs, unusual activity, or system performance issues.
A process is an instance of a program currently executing on the system.
Examples of processes include:
Each process has a unique Process ID (PID) used by the operating system to track and manage it.
| Process Type | Description |
|---|---|
| Foreground Process | Runs directly in the terminal |
| Background Process | Runs without user interaction |
| System Process | Runs in the background for system operations |
| Daemon Process | Long-running background services |
Example of running a process in the background:
firefox &
The & symbol sends the process to the background.
Linux provides several commands to view running processes and system activity.
ps (Process Status)The ps command displays currently running processes.
Example:
ps
To see all processes running on the system:
ps aux
Example output:
USER PID %CPU %MEM COMMAND
root 1023 0.2 1.0 sshd
student 2456 1.3 2.5 firefox
Explanation:
| Column | Meaning |
|---|---|
| USER | Owner of the process |
| PID | Process ID |
| %CPU | CPU usage |
| %MEM | Memory usage |
| COMMAND | Program running |
This command is useful when investigating suspicious or unknown processes.
topThe top command provides a real-time view of system processes.
top
It displays:
Features:
Exit with:
q
htophtop is an improved and interactive version of top.
Features include:
If not installed, it can be installed using:
sudo apt install htop
Run:
htop
This tool is widely used by system administrators and security analysts.
Sometimes processes may freeze, consume too many resources, or behave suspiciously. Linux provides commands to terminate or control such processes.
killThe kill command terminates a process using its PID.
Example:
kill 2456
This sends a signal to terminate the process.
Force kill a process:
kill -9 2456
Explanation:
| Signal | Meaning |
|---|---|
| 15 | Graceful termination |
| 9 | Forceful termination |
The -9 signal is used when a program refuses to close normally.
pkillThe pkill command terminates processes by name instead of PID.
Example:
pkill firefox
This stops all processes named firefox.
This is useful when multiple instances of a program are running.
Monitoring system resources is important for:
Key system resources include:
| Resource | Description |
|---|---|
| CPU | Processing power |
| RAM | Memory usage |
| Disk | Storage usage |
| Network | Data traffic |
Useful commands include:
Check memory usage:
free -h
Check disk space:
df -h
Check disk usage of directories:
du -h
These commands help administrators identify resource-heavy programs.
Linux uses services to run important background functions like networking, logging, and web servers.
Modern Linux systems manage services using systemd, controlled with the systemctl command.
systemctl status ssh
This displays the status of the SSH service.
sudo systemctl start apache2
sudo systemctl stop apache2
sudo systemctl restart apache2
sudo systemctl enable apache2
sudo systemctl disable apache2
Monitoring processes helps security professionals:
Attackers often hide malicious software as background processes, so process monitoring is a critical security practice.
In this module, students learned:
ps, top, and htopkill and pkillsystemctlThese skills are essential for Linux administration, incident response, and cybersecurity operations.