How to list and stop processes

Overview

Every running program is a process with a process ID (PID). First identify the correct process, then request a graceful stop before forcing termination.

Examples

ps aux
ps aux | grep firefox
top
kill 1234
pkill -x firefox
kill -9 1234

Commands and signals

  • ps aux takes a snapshot of all users' processes
  • top gives an updating view; press q to quit
  • kill PID sends SIGTERM, allowing cleanup
  • pkill -x name targets an exact process name
  • kill -9 PID sends SIGKILL and should be a last resort

Safety

Verify the PID and owner before stopping anything. Killing desktop or system processes can lose unsaved work or destabilize the session.

Do not use sudo kill unless you understand why the process belongs to another user and why it must stop.