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 LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted