Skip to content
Linux

Process Management

List, signal, and monitor running processes.

#process#kill#signal

Code

linux
# List processes
ps aux | grep nginx
ps -ef --forest               # tree view
pgrep -fl nginx

# Top and htop for live monitoring
top -o %CPU
htop

# Send signals
kill 1234                      # SIGTERM
kill -9 1234                   # SIGKILL (force)
pkill -f "node server.js"
killall nginx

# Background and foreground
long-task &
jobs
fg %1
bg %2
nohup ./server > server.log 2>&1 &

# Nice and renice for priority
nice -n 10 ./batch-job
renice -n -5 -p 1234