Skip to main content

whoisport

CI Release crates.io PyPI npm Homebrew

Platforms MSRV License: MIT Conventional Commits

crates.io downloads GitHub downloads Last commit

Find out what is listening on a port, who started it, and stop it safely. Works on Linux, macOS and Windows. One small binary, no runtime dependencies.

whoisport demo

lsof -i :3000 gives you a PID and a wall of columns. whoisport gives you the command line, the directory it was started from, who owns it and how long it has been running, which is usually what you need to decide whether to kill it. And when you do kill it, whoisport makes sure it only stops the process you were looking at.

Quickstart

whoisport              # what is listening on this machine?
whoisport 3000         # what is on port 3000, and who started it?
whoisport 3000 --kill  # ask it to exit (add --force if it refuses)
$ whoisport 3000
port    3000
pid     373232
parent  373230
user    kaitlyn
cmd     node node_modules/.bin/vite --port 3000
cwd     /home/kaitlyn/site
uptime  4m 12s

$ whoisport 3000 --kill
...
pid 373232: exited after SIGTERM

$ whoisport
PORT   PID      USER       CMD
3000   373232   kaitlyn    node node_modules/.bin/vite --port 3000
5432   ?        ?          ?
8080   41120    kaitlyn    python3 -m http.server 8080
ports marked ? are owned by another user; run with sudo to see it

Install

Platform Command
Linux, macOS curl -fsSL https://github.com/dpologdvinity/whoisport/releases/latest/download/install.sh | sh
Windows (PowerShell) irm https://github.com/dpologdvinity/whoisport/releases/latest/download/install.ps1 | iex
Any, with Rust cargo binstall whoisport (prebuilt) or cargo install whoisport (builds from source)
Any, with Python pipx install whoisport or uvx whoisport
macOS, Linux brew install dpologdvinity/tap/whoisport
Windows scoop bucket add whoisport https://github.com/dpologdvinity/scoop-whoisport then scoop install whoisport
Debian, Ubuntu download the .deb from Releases, then sudo apt install ./whoisport_*.deb
Fedora, RHEL download the .rpm from Releases, then sudo dnf install ./whoisport-*.rpm

The one-line installers

install.sh (Linux, macOS) and install.ps1 (Windows) find the binary for your machine, download it, check its SHA-256 against the release's SHA256SUMS, and only then install it. If the check fails, nothing is installed. They need no administrator rights: the binary goes to ~/.local/bin (Linux, macOS) or %LOCALAPPDATA%\Programs\whoisport (Windows, which is also added to your user PATH).

# a specific version, or a different directory
curl -fsSL https://github.com/dpologdvinity/whoisport/releases/latest/download/install.sh | sh -s -- --version v0.5.8 --dir /usr/local/bin
$env:WHOISPORT_VERSION = 'v0.5.8'; irm https://github.com/dpologdvinity/whoisport/releases/latest/download/install.ps1 | iex

Piping a download into a shell means trusting it, so read the script first if you like (install.sh, install.ps1); to pin it, use the URL of a specific release, …/releases/download/v0.5.8/install.sh. To uninstall, delete the whoisport binary from that directory.

Or download a binary from the Releases page: Linux (static, x86_64 and aarch64), macOS (Apple silicon and Intel) and Windows (x86_64).

Supported systems: Linux (reads /proc, no other tools needed), macOS (uses the built-in lsof), Windows 10 and 11.

Usage

whoisport [PORTS]... [--kill [--force]] [--json] [--udp]
You type You get
whoisport A table of every listening port
whoisport 3000 8080 Details of what is on each port (repeated ports are shown once)
whoisport 3000 --kill The details, then the process is asked to exit and given 3 seconds
whoisport 3000 --kill --force Same, but forcibly ended if it does not exit
whoisport --json The same data as a JSON array, for scripts
whoisport --udp UDP sockets instead of TCP

--kill always needs explicit ports; it never means "kill everything". --json cannot be combined with --kill.

JSON output

--json prints an array with one object per listener. Every object has the same keys; what is unknown (for example the owner of a process you may not inspect) is null:

[
  {
    "port": 3000, "proto": "tcp", "pid": 373232, "ppid": 373230, "user": "kaitlyn",
    "cmd": "node node_modules/.bin/vite --port 3000", "cwd": "/home/kaitlyn/site",
    "uptime_secs": 252, "container": null, "image": null
  }
]

Exit codes

Code Meaning
0 Success: everything asked for was found (and killed, if asked)
1 A requested port has nothing listening, or nothing is listening at all
2 Invalid arguments
3 A kill failed, or a process holding the port was deliberately not killed (see below), so the port may still be in use

Reading ?

On Linux, a process owned by another user cannot be inspected without sudo, so its row shows ?. On macOS lsof only lists your own processes without sudo, so other users' listeners are missing. On Windows, details of system services need an elevated terminal.

Stopping processes safely

--kill is built so that it cannot take down more than you meant to:

  • The process you saw is the process that is signalled. Each target is identified by its pid and its start time. If it exits and the system hands its pid to something else, that something else is left alone.
  • Service managers and parents are never signalled. When several processes share a socket (a supervisor and its workers, or systemd socket activation), stopping the supervisor takes down far more than one port. systemd, launchd and svchost.exe, and any process that is a parent of another holder, are skipped. whoisport then says which one still holds the port and exits 3.
  • It asks first. Each target is asked to exit; it is forced only with --force.
Platform --kill asks by --force
Linux, macOS SIGTERM SIGKILL
Windows Ctrl+C in the process's console, and WM_CLOSE to its windows TerminateProcess

On Windows, Ctrl+C reaches every program attached to a console, so whoisport only sends it when the target's console holds nothing but the target, its child processes and a shell. Otherwise it says so and leaves the choice of --force to you.

Text from other processes (command lines, paths) is printed with control characters, bidirectional-text overrides and zero-width characters escaped, so a hostile process cannot rewrite your terminal or disguise what it is.

Docker

When a port is published by a container, whoisport shows the container name and image (docker web (nginx:alpine)), even though the docker-proxy process behind it is owned by root. Docker is consulted only when a listener looks like Docker's forwarder or its owner cannot be read, only for a local daemon (not an ssh:// or remote DOCKER_HOST), and each Docker call is cut off after 2 seconds, so a stuck daemon never hangs whoisport: the names are simply left out. --kill on such a port prints the matching docker stop <name> command, because killing the forwarder only breaks the port mapping.

UDP

UDP has no listening state, so --udp lists bound sockets that have no remote peer. Windows does not report UDP peers, so there every bound UDP socket is listed, including short-lived client ones.

How it works

A short version (the long one is in ARCHITECTURE.md): whoisport asks the operating system which sockets are listening and which process owns each one, looks up details of those processes, and prints them. Each platform has its own small backend for that (/proc on Linux, lsof on macOS, the IP Helper API on Windows); everything else is shared.

cli ─► scan ─► output     (list, details, JSON)
         │
         └───► kill       (identity, safety rules, ask-then-force)
         ▲
   proc backend per OS · docker names

Development

cargo test                 # unit and end-to-end tests
cargo clippy --all-targets -- -D warnings

See CONTRIBUTING.md for the full workflow (formatting, coverage, checking the other platforms, commit style) and ARCHITECTURE.md for how the code is organised.

License

MIT

Metadata

Release files for whoisport 0.5.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whoisport 0.5.8
File Size Uploaded Provenance Actions
whoisport-0.5.8.tar.gz 55.3 kB With provenance Details for whoisport-0.5.8.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for whoisport 0.5.8
File Actions
whoisport-0.5.8-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for whoisport-0.5.8-py3-none-win_amd64.whl
whoisport-0.5.8-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for whoisport-0.5.8-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
whoisport-0.5.8-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for whoisport-0.5.8-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
whoisport-0.5.8-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for whoisport-0.5.8-py3-none-macosx_11_0_arm64.whl
whoisport-0.5.8-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for whoisport-0.5.8-py3-none-macosx_10_12_x86_64.whl

Total release size: 2.1 MB

Release files / whoisport-0.5.8.tar.gz

Download URL whoisport-0.5.8.tar.gz
Size 55.3 kB
Tags Source
SHA-256 checksum
How to use checksums
9fe56ca33e252df2ef0f0a9ae5e6fc127497907742505966a9cf0419d30eeb78
BLAKE2b-256 checksum
How to use checksums
fd2f11b9176124b00c3567714880ed46cb7f5023113cf04369fd577516fe8056
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / whoisport-0.5.8-py3-none-win_amd64.whl

Download URL whoisport-0.5.8-py3-none-win_amd64.whl
Size 404.8 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
6a5172b52318894c616d8106a08cab606f86da3c5053d1adeccc38043dfc7e5e
BLAKE2b-256 checksum
How to use checksums
b1460881f5fcd1bdddf974541daae39e29109780d797a26acca99efb1fa93596
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / whoisport-0.5.8-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL whoisport-0.5.8-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 426.6 kB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
50dbe83cf9413740cafebb15eadee3087521accfa716d511fceaa2576484796a
BLAKE2b-256 checksum
How to use checksums
47c8e3f225830ae76a55f88404e06bf77d807d611c6b64616a85a240bc33c0ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / whoisport-0.5.8-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL whoisport-0.5.8-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 406.5 kB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
ec0ea7dbd86609611d54301fa7d8c1d9637282e702406d25cc59d6fc393e8fb1
BLAKE2b-256 checksum
How to use checksums
5340c9d1ea3ba007748d300aa7d0091f961de5ccc7824477a10eaeb476cd9afb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / whoisport-0.5.8-py3-none-macosx_11_0_arm64.whl

Download URL whoisport-0.5.8-py3-none-macosx_11_0_arm64.whl
Size 374.0 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3cda0d65ec951600657529bea0647998fc42c4983d306c3f9ff74125e15b59e9
BLAKE2b-256 checksum
How to use checksums
4fcbb7e3a9bc6f55a1caf68358a504a30a12aacec82ebf03ff1d99162964fc55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / whoisport-0.5.8-py3-none-macosx_10_12_x86_64.whl

Download URL whoisport-0.5.8-py3-none-macosx_10_12_x86_64.whl
Size 402.6 kB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
be89d44af1a377e9531c49170ac8187258b871d0bf9e370366e794cfcf6e97c9
BLAKE2b-256 checksum
How to use checksums
b923c04531d0a2476c5ffdedb523a4866a7f7cd764ea03d15ee1cdb034911da9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

Security for whoisport 0.5.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for whoisport-0.5.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page