Skip to main content

Linux Process Management

Learn to monitor, control, and manage processes in Linux.

Viewing Processes

# List all processes
ps aux

# Real-time process monitor
top
htop  # Better alternative

# Process tree
pstree

# Find process by name
pgrep nginx
ps aux | grep nginx

Managing Processes

# Kill process
kill PID
kill -9 PID  # Force kill

# Kill by name
pkill nginx
killall nginx

# Background/foreground jobs
command &  # Run in background
jobs       # List background jobs
fg %1      # Bring job 1 to foreground
bg %1      # Resume job 1 in background

Systemd Services

# Start/stop services
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx

# Enable/disable on boot
sudo systemctl enable nginx
sudo systemctl disable nginx

# Check status
sudo systemctl status nginx

# View logs
sudo journalctl -u nginx

Next: Linux Networking →