Skip to content

yigitkonur/cli-killport

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kill any process occupying a port. unix-first, zero-zombie, one command.

npx cli-killport 3000

what it does

  1. finds every process bound to the given port (lsof, fuser, ss)
  2. shows you what it found — pid, name, user, command, state, children
  3. kills the entire process tree bottom-up (children first, parent last)
  4. sends SIGTERM → brief grace → SIGKILL (-9) → kills process group
  5. reaps zombie children by signaling parent processes
  6. verifies the port is actually free before exiting

install

# use directly with npx (no install needed)
npx cli-killport 1420

# or install globally
npm i -g cli-killport
killport 1420

# short alias
kp 1420

usage

killport <port> [options]

options

flag description
-h, --help show help
-v, --version show version
-s, --silent suppress banner and verbose output

examples

killport 1420          # kill whatever is on port 1420
killport 3000          # free up port 3000
kp 5173                # short alias
npx cli-killport 8080  # no install needed

platforms

  • macOS — first-class support via lsof
  • Linux — lsoffuserss fallback chain

why

because lsof -i :1420 | awk '{print $2}' | tail -1 | xargs kill -9 is not a real workflow. and it leaves zombie children behind.

license

MIT

About

kill any process on a port — unix-first, zero zombies, one command

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors