kill — Send a signal to a process (typically to terminate it) across all 5 shells
Equivalents in every shell
Worked examples
Force-kill a process
kill -9 <pid>Stop-Process -Id <pid> -Forcetaskkill /f /pid <pid>Kill all processes by name
pkill nodeStop-Process -Name nodetaskkill /f /im node.exeKill a process listening on a port
lsof -ti:3000 | xargs killGet-NetTCPConnection -LocalPort 3000 | Stop-Process -Id { $_.OwningProcess }for /f "tokens=5" %a in ('netstat -ano ^| findstr :3000') do taskkill /f /pid %aGotchas
- Unix `kill -9` (SIGKILL) is the unblockable kill; PowerShell `-Force` and `taskkill /f` are the equivalents but use different signaling under the hood.
- Killing a parent process on Unix does not kill children unless you signal the process group (`kill -- -$PGID`). On Windows, `taskkill /t` kills the tree.
- PowerShell `Stop-Process` cannot send arbitrary signals (no SIGHUP, SIGUSR1) — Windows processes don't have Unix signal semantics.
WSL & PowerShell Core notes
Related glossary
- Signals
Signals are tiny inter-process messages. Knowing which ones can be caught, which cannot, and which clean up vs. terminate ungracefully prevents a lot of "service won’t restart" bugs.
- Process identity
Every running program has multiple identifiers beyond its PID. They show up in `ps`, `kill`, `setsid`, job control, and every "why is my Ctrl-C being eaten" debug session.
Common tasks using kill
- Kill a process by name
Terminate every running process whose executable matches a given name.
- Kill all processes of a user
Terminate every process owned by a given user — useful for forced logout, cleanup, and runaway-session containment.
- Kill the process listening on a port
Find and terminate whatever process is bound to a TCP/UDP port — the answer to "address already in use" when a previous run did not release the socket.
- List zombie processes
Find defunct child processes whose parent forgot to `wait()` for them — the classic "Z" state — for triaging fork-bomb-like leaks, badly-written supervisors, and PID-table exhaustion incidents.
- Restart a process
Stop and re-launch a running process — useful for picking up config changes, recovering from leaks, and orchestrated reloads.
- Run a command in the background
Launch a long-running command without blocking the current shell session.
- Run a command with a timeout
Kill a command if it has not finished within N seconds — the standard hedge against hung network calls, runaway scripts, and tests that should never block forever.
- Send a signal to a process
Deliver a specific Unix signal to a process — useful for graceful shutdown, config reload, and triggered behaviour.
- Show the top processes by memory usage
Identify which running processes consume the most RAM — for debugging memory pressure, leak hunts, or "what is eating my laptop".