
Learn how to view, monitor, and control running processes on Linux using ps
, top
, htop
, and kill
. Works on Ubuntu, Debian, CentOS, and AlmaLinux.
Before starting make sure ur linux is ready.
- Ubuntu: ubuntu.com/download
- Debian: debian.org/distrib
- CentOS Stream: centos.org/download
- AlmaLinux: almalinux.org/download
- Talkecho full toturial: Click here
Listing Processes with ps
# show your processes
ps
# show all processes with details
ps aux
# search for a specific process
ps aux | grep ssh
The columns show PID (process ID), USER, CPU and memory usage, and the command running.
Monitoring Processes with top
top
top
updates in real time, showing CPU, memory usage, and active processes. Useful keys:
- P – sort by CPU
- M – sort by memory
- K – kill a process (enter PID)
- Q – quit
htop (Improved top)
Install it first:
# Ubuntu/Debian
sudo apt install -y htop
# CentOS/AlmaLinux
sudo dnf install -y htop
Launch with:
htop
htop
shows a color-coded, interactive view. Use arrow keys to navigate, F9 to kill, F10 to quit.
Killing Processes
# kill by PID
kill 1234
# force kill
kill -9 1234
# kill by process name
pkill firefox
# kill all matching processes
killall apache2
Use kill -9
only if a process ignores normal signals.
Checking Resource Usage
# show CPU usage
uptime
# show memory usage
free -h
# show disk usage
df -h
Combine these with process commands for better system monitoring.