A superfast cross platform port killer tool.
rekt is available only on Linux and Windows as of now.
Download the latest release for your platform from the releases page.
go install github.com/shravanasati/rekt@latestrekt 8000rekt 8000 -vrekt 8000 -trekt 8000 -kYou may want to run rekt with sudo permissions to find and kill processes started by users other than you.
Do note that on Linux, --terminate/-t sends SIGTERM and --kill/-k sends SIGKILL.
On Windows, the behavior of both flags is identical.
rekt is consistently 8x faster than fuser and 4x faster than lsof.
Here are results from a run on my PC.
| Command | Runs | Average [ms] | User [ms] | System [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|---|---|---|
rekt 8000 |
690 | 3.92 ± 0.40 | 2.79 | 8.89 | 3.33 | 5.66 | 1.00 ± 0.00 |
lsof -i :8000 |
179 | 16.74 ± 3.23 | 3.58 | 12.18 | 14.42 | 38.14 | 4.27 ± 0.93 |
fuser 8000/tcp |
97 | 32.00 ± 2.36 | 11.16 | 20.48 | 29.62 | 38.94 | 8.16 ± 1.03 |
You can run these benchmarks yourself using atomic or hyperfine as follows:
-
Start a server in background.
python -m http.server 8000 & -
Run the benchmark.
atomic "fuser 8000/tcp" "lsof -i :8000" "rekt 8000" -w 10OR
hyperfine "fuser 8000/tcp" "lsof -i :8000" "rekt 8000" -w 10 -N
