Skip to content

DasKaroWow/portwho

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

portwho

Tests Python PyPI version License

Small CLI utility to find which process is using a port and optionally stop it.

What it does

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.

Features

  • 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

Installation

Clone the repository and install it in a virtual environment.

pipx install portwho

or with uv

uv tool install portwho

Requirements

  • Python 3.10+
  • psutil

Usage

Basic form:

portwho <port>

Examples:

portwho 8000
portwho 8000 --protocol tcp
portwho 53 --protocol udp
portwho 8000 --kill
portwho 8000 --force

Command line arguments

port

Target port number.

Example:

portwho 8000

--protocol {tcp,udp}

Choose which protocol to inspect.

Default:

tcp

Examples:

portwho 8000 --protocol tcp
portwho 53 --protocol udp

--kill

Try to stop processes using the port.

Example:

portwho 8000 --kill

--force

If normal termination times out, force kill the process.

Example:

portwho 8000 --force

Notes

  • process termination may fail due to insufficient permissions
  • some system or protected processes may not expose full metadata

License

MIT License.

About

Small CLI utility to find which process is using a TCP or UDP port

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages