In Linux, processes are instances of programs that are being executed. Each process has its own memory space and system resources. Understanding how to work with processes is crucial in cybersecurity for tasks like monitoring, killing malicious processes, managing system resources, and analyzing system performance. This section will cover essential commands for managing processes in Linux, as well as tools to view and manipulate processes.

What is a Process?

A process is a running instance of a program. It can be a simple command like ls or a complex system program like sshd (the SSH daemon). Processes are assigned unique IDs known as Process IDs (PIDs).

Each process is created when a program is executed and is assigned:

Viewing Running Processes

To view running processes, you can use commands like ps, top, htop, and pgrep.

ps (Process Status)

USER  | PID  | %CPU | %MEM | VSZ   | RSS   | TTY   | STAT | START | TIME | COMMAND
user1 | 1234 | 0.0  | 0.1  | 5232  | 2348  | pts/0 | S    | 10:12 | 0:00 | bash
root  | 4567 | 0.1  | 2.5  | 34560 | 15684 | tty1  | Ss   | 09:45 | 0:12 | /sbin/init