lsoff – lists listening TCP/UDP ports

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 in action
Click image for full size

lsoff is written in Go. Learn Go with our recommended free books and free tutorials.


Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted