QR CookingNotes

CookingNotes

Your Personal Recipe Book

Get it on Google Play
QR FiNoteMe

FiNoteMe

Smart Finance Tracker

Get it on Google Play
linuxserver Linux processes are simply tasks your system is working on, and learning how to view, monitor, and control them is a must-have skill for anyone managing a Linux server. In this beginner-friendly guide, you’ll learn how to use essential commands like ps, top, htop, and kill to understand what’s happening behind the scenes — and how to fix things when a process misbehaves.

Understanding Linux Processes for Beginners: ps, top, htop, kill

5 Min Read Verified Content

If you’re just getting started with Linux server management, there’s one thing you must learn early: how to handle processes. Processes are basically the programs and tasks running on your server — some visible, many invisible. When something slows down, freezes, eats too much memory, or refuses to stop… knowing how to inspect and control processes becomes extremely important.

Don’t worry — you don’t need to be a guru to master this. I’ll walk you through each tool step by step, in the simplest way possible, like an older friend guiding you through your first Linux adventure.




What Are Processes in Linux? (Very Simple Explanation)

Think of your Linux system like a kitchen:

  • Each process is a chef working on a dish

  • Some chefs (background processes) work quietly

  • Some chefs (foreground processes) are loud and visible

  • Too many chefs can make the kitchen chaotic

  • And sometimes… you need to ask a chef to stop cooking

Tools like ps, top, htop, and kill help you “look into the kitchen” and keep things under control.




1. Seeing Running Processes with ps

The ps command is like a snapshot — it shows what's running right now.

Example: Show All Processes

ps aux

Explanation:

  • a — show processes for all users

  • u — show the user who owns each process

  • x — include background processes too

This gives you a long, detailed list. If you're new, this list might look intimidating — that’s okay. What matters is you can now see what’s running.

Useful Tip: Search for a specific process:

ps aux | grep nginx

This helps you quickly find what you’re looking for.




2. Real-Time Monitoring with top

top is like a live dashboard. It updates every few seconds and shows CPU, memory usage, process IDs, and more.

Run it with:

top

Inside top, you’ll see:

  • CPU usage

  • Memory usage

  • Load average

  • All processes sorted by resource usage

Helpful Keys Inside top:

  • P — sort by CPU usage

  • M — sort by memory usage

  • k — kill a process

  • q — quit

This is perfect for spotting “greedy” processes that slow your server.




3. A Friendlier Version of top: htop

If top feels too old-school, htop will feel like a modern upgrade.

Install it:

sudo apt install htop # Ubuntu/Debian sudo yum install htop # CentOS/RHEL

Run it:

htop

Why beginners love htop:

  • Colorful

  • Easier to read

  • You can scroll

  • Interactive controls

You can sort by memory, CPU, user, and more — all with arrow keys.

Most administrators use htop every day because it’s just more comfortable.




4. How to Kill a Process: Using kill

Sometimes, a process gets stuck…
Sometimes, it becomes a CPU monster…
Sometimes, an app refuses to close properly…

That’s when you need the kill command.


1. Find the Process ID (PID):

ps aux | grep appname

You’ll see a number — that’s the PID.


2. Stop the process gently:

kill PID_NUMBER

3. If it refuses to stop, use force:

kill -9 PID_NUMBER

Important: Use -9 only when absolutely necessary — it’s like pulling the plug.




Real Life Example (Simple & Practical)

Let’s say your Node.js app froze.


Step 1 — Find it:

ps aux | grep node

You find PID 1834.


Step 2 — Try stopping it:

kill 1834

If it still doesn’t stop:


Step 3 — Force it:

kill -9 1834

Done — problem solved.



When Should You Use Each Tool?


ToolBest ForExplanation
psQuick snapshotGreat for searching for a specific process
topLive monitoringHelps detect issues fast
htopComfortable monitoringEasy for beginners, very visual
killStopping problem processesNecessary for troubleshooting
Advertisement
Back to Linuxserver