Small CLI utility to find which process is using a port and optionally stop it.
portwho helps you:
- inspect a TCP or UDP port
- see which process is bound to that port
- view basic process information
- optionally terminate that process
- optionally force kill it if graceful termination does not work
This is useful when a local server fails to start because a port is already occupied.
- supports TCP and UDP
- shows PID, process name, executable path, command line, and status
- groups listeners by process
- can terminate processes on the target port
- supports graceful stop with optional force kill fallback
- simple terminal output
Clone the repository and install it in a virtual environment.
pipx install portwhoor with uv
uv tool install portwho- Python 3.10+
psutil
Basic form:
portwho <port>Examples:
portwho 8000
portwho 8000 --protocol tcp
portwho 53 --protocol udp
portwho 8000 --kill
portwho 8000 --forceTarget port number.
Example:
portwho 8000Choose which protocol to inspect.
Default:
tcp
Examples:
portwho 8000 --protocol tcp
portwho 53 --protocol udpTry to stop processes using the port.
Example:
portwho 8000 --killIf normal termination times out, force kill the process.
Example:
portwho 8000 --force- process termination may fail due to insufficient permissions
- some system or protected processes may not expose full metadata
MIT License.