A Rust CLI that kills processes bound to specified ports using progressively aggressive signals.
cargo install --path .murder <PORT>...
murder 4000
murder 3000 4000 5000Sends signals in order, waiting up to 2 seconds per level before escalating:
- SIGINT (2) - Polite interrupt
- SIGTERM (15) - Termination request
- SIGKILL (9) - Force kill
Polls every 100ms to check if the process has terminated. Total timeout is 10 seconds.
Multiple ports are processed in parallel. If the same PID is bound to multiple ports, it's only killed once.
If permission is denied (EPERM), murder re-executes itself with sudo.
$ murder 4000
[4000] Found PID 1234 (node)
[4000] Sending SIGINT to PID 1234
[4000] Process still running, waiting...
[4000] Sending SIGTERM to PID 1234
[4000] Process terminated
- 0 - Success (all processes killed, or no process was bound)
- 1 - Failure (unable to kill one or more processes)
- macOS (uses
lsof) - Linux (uses
ssor/proc/net/tcp)
murder is released under the Apache License 2.0.
This package was written by Elliot Jackson.
- Blog: https://elliotekj.com
- Email: elliot@elliotekj.com