Whoport
A simple CLI tool to check if and which PID uses a given port number and optionally kill it.
Install / Use
/learn @flipace/WhoportREADME
whoport
A simple nodejs based CLI tool to check if and which PID uses a given port number and optionally kill it.
Installation
npm i -g whoport
Compatibility
Tested on:
- macOS 10.10.5, 10.11.4, 10.14.6
- Windows 7
- Debian 7.8 (wheezy)
Due to the use of netstat for Windows operating systems, whoport should also work on Windows Vista and above. (thanks @lewisje for the hint!)
How it works
- OSX uses
lsofto check for processes andkill -9to kill one or more PIDs. - Windows uses
netstatto check for processes andtaskkillto kill the PID.
Usage
# check and display PID and process name if present
whoport 9090
# kill process which uses port
whoport 9090 -k
FAQ
No process found but something is listening. (OSX)
You need to execute whoport with sudo if a process runs via another or root user. Also see man lsof section "Security".
Contributing
Pull Requests are very welcome!
If you find any issues, please report them via Github Issues and include your nodejs version and OS.
License
(MIT)
Related Skills
node-connect
351.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
