Operations 6 min read

Master Linux Process Management and System Monitoring with Top, Htop, and ps

Learn how to diagnose CPU, memory, and I/O bottlenecks on Linux by using Top, Htop, ps, kill, and background‑task commands to pinpoint resource‑hungry processes and resolve performance issues without blind reboots.

Ubuntu
Ubuntu
Ubuntu
Master Linux Process Management and System Monitoring with Top, Htop, and ps

1. Command‑line Task Managers: Top and Htop

Running top displays a real‑time list of processes with columns such as PID, USER, %CPU, %MEM, and COMMAND; press q to quit.

Htop offers a more visual, mouse‑friendly interface. Install it with sudo apt install htop and start with htop. Key shortcuts:

F6 – sort by CPU or memory

F9 – kill a selected process

F10 – exit

2. Process Management Commands

ps (Process Status)

View a snapshot of current processes. Examples:

ps aux          # show detailed info for all processes
ps aux | grep nginx   # find processes related to nginx

kill

Terminate processes. Examples:

kill PID               # graceful termination (SIGTERM)
kill -9 PID            # forceful termination (SIGKILL), use with caution
killall firefox        # kill all processes named firefox

Typical workflow: try kill first and wait; if the process remains unresponsive, use kill -9. The -9 flag acts as a “stop‑loss” button but may prevent data from being flushed to disk.

Background Execution

Ctrl+Z – suspend the current foreground job and move it to the background. bg – resume a suspended job in the background. fg – bring a background job back to the foreground. command & – start a command directly in the background (e.g., python server.py &).

3. System Resource Monitoring

System Monitor (GUI)

Ubuntu includes a graphical task manager similar to Windows Task Manager; launch it by searching for “System Monitor” in Activities.

btop

A highly visual CLI monitor that even supports game‑pad input.

sudo snap install btop

4. Fault Diagnosis Workflow: Identify the Bottleneck Type

Overall Load

Run uptime to see the load average, which quickly indicates whether the system is constantly queuing tasks.

CPU Busy – Find the Top CPU Consumers

ps -eo pid,comm,%cpu,%mem --sort=-%cpu | head

Memory Shortage – Check for Swapping

free -h

If Swap usage continuously rises and the system slows down, the issue is likely memory pressure. Before killing processes, verify whether a memory leak, excessive browser tabs, or an oversized container is the root cause.

I/O Stuck – Low CPU but Slow System

Typical signs are low CPU usage while file opens and application launches are sluggish. First check disk space, then identify processes with heavy I/O using the I/O columns shown in htop.

5. Practical Troubleshooting Scenario

Open a terminal and run htop.

Press F6 and select %CPU to sort processes by CPU usage.

Notice a process named chrome consuming 100% CPU.

Select that process, press F9, choose SIGKILL, and confirm.

The system becomes responsive again.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Process ManagementLinuxSystem MonitoringTopHtoppskill
Ubuntu
Written by

Ubuntu

Focused on Ubuntu/Linux tech sharing, offering the latest news, practical tools, beginner tutorials, and problem solutions. Connecting open-source enthusiasts to build a Linux learning community. Join our QQ group or channel for discussion!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.