🐧 Linux / Shell Scripting
Beginner
How do you kill a process in Linux?
Answer
Use the kill command with a PID. kill PID sends SIGTERM (signal 15) — a graceful termination request. kill -9 PID sends SIGKILL — forces immediate termination and cannot be caught or ignored. Find PID with ps aux | grep name or pgrep name. pkill processname kills by name without needing the PID. killall processname kills all processes with that name. Use SIGTERM first and only escalate to SIGKILL if the process doesn't respond, as SIGKILL doesn't allow cleanup.