Skip to content
shellmap

killSend a signal to a process (typically to terminate it) across all 5 shells

Equivalents in every shell

Bashunix
kill <pid>
Zshunix
kill <pid>
Fishunix
kill <pid>
PowerShellwindows
Stop-Process -Id <pid>

Aliased as `kill` and `spps`.

cmd.exewindows
taskkill /pid <pid>

Add `/f` to force, `/t` to kill child processes.

Worked examples

Force-kill a process

Bash
kill -9 <pid>
PowerShell
Stop-Process -Id <pid> -Force
cmd.exe
taskkill /f /pid <pid>

Kill all processes by name

Bash
pkill node
PowerShell
Stop-Process -Name node
cmd.exe
taskkill /f /im node.exe

Kill a process listening on a port

Bash
lsof -ti:3000 | xargs kill
PowerShell
Get-NetTCPConnection -LocalPort 3000 | Stop-Process -Id { $_.OwningProcess }
cmd.exe
for /f "tokens=5" %a in ('netstat -ano ^| findstr :3000') do taskkill /f /pid %a

Gotchas

  • 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

pwsh`kill` is an alias for `Stop-Process` on every PowerShell platform (Windows + pwsh on Linux/macOS). It cannot send arbitrary signals — only terminate. On Linux/macOS pwsh the system `kill` is also in PATH; choose explicitly when you need SIGHUP, SIGUSR1, etc.
WSL`kill <pid>` inside WSL only affects Linux processes. To terminate a Windows process from WSL, run `taskkill.exe /PID <pid>` — the `.exe` suffix invokes the Windows binary through interop. PIDs are not shared between the two worlds.

Related glossary

Common tasks using kill

Related commands