A simple nodejs based CLI tool to check if and which PID uses a given port number and optionally kill it.
npm i -g whoport
Due to the use of
netstat for Windows operating systems, whoport should also work on Windows Vista and above. (thanks @lewisje for the hint!)
lsofto check for processes and
kill -9to kill one or more PIDs.
netstatto check for processes and
taskkillto kill the PID.
check and display PID and process name if present whoport 9090 kill process which uses port whoport 9090 -k
You need to execute whoport with sudo if a process runs via another or root user. Also see man lsof section "Security".
Pull Requests are very welcome!
If you find any issues, please report them via Github Issues and include your nodejs version and OS.