Beginner LevelLinux Commands & SysAdmin
How do ps, top, htop, kill, and killall manage Linux processes?
❓ Interview Prompt: Explain process management, viewing PID/CPU/RAM metrics (ps aux, top), and terminating processes (SIGTERM 15 vs SIGKILL 9).
Process management involves monitoring and controlling executing tasks:
Monitoring Commands:
•
'ps aux': Snapshot list of all running processes with PID, CPU, and RAM metrics.
•
'top' / 'htop': Real-time interactive process monitor.
Termination Signals:
•
'kill -15 <PID>' (SIGTERM): Graceful termination request (allows process to clean up resources).
•
'kill -9 <PID>' (SIGKILL): Forceful kernel termination (immediately kills process without cleanup!).
Code Implementation Example
bash
# View process details matching 'nginx'
ps aux | grep nginx
# Gracefully terminate process
kill -15 1234
# Forcefully terminate process if unresponsive
kill -9 1234
# Kill all instances by process name
killall -9 node💡Inspecting and terminating Linux processes using ps and kill signals.
🎯 Interview Key Takeaway
Use SIGTERM (kill -15) first for graceful process shutdown; reserve SIGKILL (kill -9) for frozen processes.
#Processes#ps#top#kill#SIGKILL#Beginner
Back to all Linux Commands & SysAdmin Questions→