A running program is a process. Shells, web servers, Python applications, and background services all create processes. Every running instance has a PID; a restart normally creates a new PID, so it is not a permanent program identifier.
Inspect processes
ps shows processes related to the current terminal—including ps itself briefly. ps aux gives a system-wide snapshot with user, PID, CPU, memory, and command. ps aux | grep nginx filters nginx but may also match the grep command.
top continually refreshes uptime, CPU, memory, process count, and resource use; q usually exits. htop may be friendlier but is not always installed, so top remains the dependable baseline.
1 · Identifyps aux / top
2 · Terminate cleanlykill PID → SIGTERM
3 · Last resortkill -9 PID → SIGKILL
Signals and safe termination
kill 2451 normally sends SIGTERM, asking the process to exit and allowing cleanup of files, state, and connections. If it is completely unresponsive, kill -9 2451 sends SIGKILL; the kernel terminates it without cleanup, so it is not the first choice.
pkill firefox matches by name and can affect many processes. Beginners gain clearer scope by locating one PID first. A foreground command such as ping example.com can usually be interrupted with Ctrl+C.
Do not casually stop unfamiliar system processes
Before termination, ask who started it, which service owns it, why it uses resources, and who will be affected. High CPU does not justify immediate kill -9; stopping a critical process can interrupt services or disconnect your remote session.
Default sequence: verify target → SIGTERM → wait and verify → consider SIGKILL only if truly unresponsive.
Process Signal Simulator
PID 2310KNOWLEDGE QUIZ
KNOWLEDGE QUIZ
Investigate a Runaway Python Job
A server CPU alert points to report.py. Write the sequence from identification to safe termination; do not begin with kill -9.
- List system processes and filter report.py.
- Use top to confirm sustained resource use and record the PID.
- Send a normal termination request to sample PID 2451.
- Wait, verify whether it remains, and write the last resort only after confirming it is unresponsive.