Skip to content

shravanasati/rekt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rekt

A superfast cross platform port killer tool.

Installation

rekt is available only on Linux and Windows as of now.

From releases (recommended)

Download the latest release for your platform from the releases page.

Using Go (requires Go>=1.25)

go install github.com/shravanasati/rekt@latest

Usage

Find process occupying a port
rekt 8000
Show more information about the process (name, owner)
rekt 8000 -v
Terminate the process
rekt 8000 -t
Kill the process
rekt 8000 -k

You 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.

Benchmarks

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:

  1. Start a server in background.

    python -m http.server 8000 &

  2. Run the benchmark.

    atomic "fuser 8000/tcp" "lsof -i :8000" "rekt 8000" -w 10

    OR

    hyperfine "fuser 8000/tcp" "lsof -i :8000" "rekt 8000" -w 10 -N

About

superfast cross platform port killer

Topics

Resources

License

Stars

Watchers

Forks

Contributors