vulkro scan-port
Lists every process on this machine that is listening on a TCP or UDP port: pid, parent, user, command, port and bind address. macOS and Linux only.
vulkro scan-port
vulkro scan-port --port 3000 --format json
vulkro scan-port --monitor
Compare it with vulkro scan: a listener with no endpoint in the source (a debug port left on, an extra agent), or an endpoint in the source with no listener, is worth a look.
PID PPID USER PROTO BIND COMMAND COMMAND LINE
94530 dev TCP *:3031 node node /.../docusaurus serve --port 3031
4693 dev TCP ::1:5173 node node /.../vite/bin/vite.js
2 listener(s); 0 system-daemon listener(s) hidden.
Flags
| Flag | Description |
|---|---|
--port <PORT> | Only listeners on this port. |
--include-system | Show system daemons (launchd, systemd, mDNSResponder, containerd and similar), hidden by default. |
--format <FORMAT> | table (default) or json. |
--monitor | Refresh every 2 seconds and print only changes. Ctrl-C to stop. |
--kill <PID> | Send SIGTERM to the pid after a y/N prompt on the terminal. |
--force | With --kill: send SIGKILL and skip the prompt. |
Without --force, --kill refuses to run when stdin is not a terminal, so a script cannot kill a process by accident.
It uses lsof and ps under the hood.
Exit codes
0 done (including no matches, or a successful --kill). 2 lsof missing, bad output, or the kill failed. 1 is not used today.