PortTop is a terminal-based TUI for monitoring local network ports, showing which process owns each socket, and optionally running a one-shot nmap scan on a selected port.
- Live dashboard for CPU, memory, and process count
- Table of TCP/UDP sockets with PID, process name, user, and status
- Quick kill: highlight a row and press
k - Optional
nmapscan for a selected port (s)
- PortTop does not scan the network automatically. It only runs
nmapwhen you presss. - For full visibility (system processes + killing), run with
sudo.
- Python 3.8+
psutil,textualnmap(optional, only for the scan feature)
- Ubuntu/Debian:
sudo apt install nmap - macOS:
brew install nmap - Arch:
sudo pacman -S nmap
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtOptional (installs the porttop entrypoint):
pip install -e .python port_killer.pyFor full visibility and kill permissions:
sudo ./venv/bin/python3 port_killer.pyIf you installed the entrypoint:
porttop
sudo porttop| Key | Action |
|---|---|
| ↑/↓ | Navigate |
| k | Kill selected PID |
| s | Nmap scan selected port |
| r | Refresh table |
| q | Quit |
- Permission denied when killing a process: run with
sudo. - Nmap not found: install
nmap(see Requirements).
MIT (see LICENSE).
