lsoff is a command-line and terminal user interface utility for finding processes listening on TCP and UDP ports.
It acts as a port-focused alternative to lsof, showing process, PID, executable path, command line, working directory and socket details. It runs on Linux, macOS and Windows without invoking lsof, ss or netstat.
This is free and open source software.
Key Features
- Lists listening TCP and UDP sockets in an interactive terminal interface.
- Falls back to a plain table when output is not a terminal.
- Searches by port, PID, process name, path, command line, project or service.
- Combines space-separated search terms using AND matching.
- Supports TCP-only and UDP-specific queries.
- Provides JSON output for scripts and command-line workflows.
- Groups sockets belonging to the same PID and lets you expand them.
- Sorts by selectable columns and supports mouse interaction.
- Offers automatic refresh every two seconds and manual reloads.
- Copies the selected address and port to the clipboard.
- Terminates selected processes after confirmation.
- Verifies process identity before signalling to avoid reused PID mistakes.
- Uses pidfd_open on Linux and escalates from SIGTERM to SIGKILL.
- Protects PID 1 and lsoff itself from termination.
- Sanitizes process names, paths and command lines before terminal display.
- Reads Linux socket and process information directly from /proc.
- Uses native operating-system APIs on macOS and Windows.
Website: github.com/yutat23/lsoff
Support:
Developer: yutat23
License: MIT License

lsoff is written in Go. Learn Go with our recommended free books and free tutorials.
Explore our carefully curated directory of recommended free and open source software, covering every major software category.The directory forms part of our extensive collection of articles for Linux enthusiasts. It includes hundreds of detailed reviews, together with free and open source alternatives to proprietary software from companies such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. LinuxLinks also covers interesting projects worth exploring, Linux-compatible hardware, free programming books and tutorials, and much more. Know a useful free and open source Linux application that we haven’t covered? Tell us about it using our submission form. |


Please read our Comment Policy before commenting.