ss

command
v0.0.0-...-d50dccc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 5 Imported by: 0

README

ss - Socket Statistics

A cross-platform socket statistics utility for displaying information about network connections, similar to the Linux ss command but available on macOS.

Overview

ss is a command-line tool that displays socket information, allowing you to view active network connections, listening ports, and associated processes. It's designed to provide similar functionality to the Linux ss command but works on macOS by leveraging the lsof command under the hood.

Features

  • Display TCP and UDP socket information
  • Filter for listening sockets only
  • Show process information for each socket
  • Display all sockets (both listening and established)
  • Numeric output option to avoid hostname resolution

Installation

go install github.com/presbrey/cmd/ss@latest

Usage

Usage: ss [options]

Options:
  -a    Display all sockets (listening and non-listening)
  -h    Display help
  -l    Display only listening sockets
  -n    Show numeric addresses instead of resolving host names
  -p    Show process using socket
  -t    Display TCP sockets
  -u    Display UDP sockets

Examples:
  ss -t       # Show TCP sockets
  ss -ua      # Show all UDP sockets
  ss -nlpt    # Show listening TCP socket processes in numeric format

Output Format

The output includes the following columns:

  • Netid: Protocol (tcp, udp)
  • State: Socket state (LISTEN, ESTABLISHED, etc.)
  • Local Address:Port: Local address and port
  • Peer Address:Port: Remote address and port
  • Process: Process name and PID (when using the -p option)

Implementation Details

This tool is implemented in Go and uses platform-specific methods to gather socket information:

  • On macOS, it uses the lsof command to collect socket information

License

[License information]

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL