Linux process management cheat sheet: htop, pgrep, kill, pkill, xkill
What is the purpose of the htop command?
Apuntes
please explain with short examples the commands htop pgrep kill pkill xkill with main accompaning/modificating functions of eachHere’s a clear and concise explanation of the most commonly used process management commands in Linux, with short practical examples: CommandWhat it doesMost useful options / modifiersShort real-life exampleshtopInteractive, colorful process viewer (better than top)-d (delay in tenths of sec) -u user (show only one user) -p PID,... (show only these PIDs)```bashpgrepLooks for processes by name and returns their PID(s)-f (match full command line) -u user (only this user) -x (exact name match) -l (show name too) -a (show full command line)bash<br>pgrep firefox # → 3421 4189<br>pgrep -l nginx # → 1234 nginx<br>pgrep -f "python app.py" # finds python processes running app.py<br>pgrep -u martin chrome # only my chrome processes<br>pgrep -a python # shows full command lines<br>killSends a signal to a process (by PID)-9 / -SIGKILL (force kill) -15 / -SIGTERM (polite terminate – default) -1 / -HUP (reload config) -l (list signals)bash<br>kill 3421 # polite terminate (SIGTERM)<br>kill -9 3421 # force kill now!<br>kill -HUP $(pgrep nginx) # reload nginx config<br>kil...
Estudia con juegos interactivos
Sube tus apuntes y genera flashcards, examenes y mas con IA
Empezar gratis