YouTip LogoYouTip

Linux Process Management

Introduction

Process management is a core skill for Linux administrators. Every running program is a process that consumes CPU, memory, and other system resources. Learning to manage processes helps you troubleshoot issues and optimize performance.

Viewing Processes

# List all processes
ps aux

# Process tree
pstree

# Real-time process monitor
top
htop

# Find specific process
ps aux | grep nginx

Controlling Processes

# Run process in background
./script.sh &

# Bring to foreground
fg %1

# Send to background
bg %1

# Kill a process by PID
kill 1234

# Force kill
kill -9 1234

# Kill by name
killall python3

Process Priority

# Run with nice priority (-20 highest, 19 lowest)
nice -n 10 ./heavy_task.sh

# Change priority of running process
renice -5 -p 1234

System Services with systemd

# Start a service
sudo systemctl start nginx

# Enable at boot
sudo systemctl enable nginx

# Check status
sudo systemctl status nginx

# View service logs
journalctl -u nginx -f

Summary

Master process management to monitor system health, control resource usage, and manage background tasks effectively.

← Linux Networking CommandsLinux File System and Permissi β†’