Skip to content
Latchkey

ss Command Reference: Flags, Usage & CI Examples

ss reports socket statistics, faster and more capable than netstat.

ss (from iproute2) shows sockets and listening ports by reading kernel state directly. It is the modern replacement for netstat and is present on most current Linux images.

Common flags and usage

  • -t / -u: TCP / UDP sockets
  • -l: listening sockets only
  • -n: numeric addresses and ports
  • -p: show the owning process
  • -s: summary statistics by socket type
  • state ... and 'sport = :PORT': filter by state or port

Example

shell
ss -tlnp | grep ':6379' || echo "redis not listening yet"

In CI

ss -tlnp is the preferred check for whether a service bound its port on a runner, since iproute2 ships on most modern images while net-tools (netstat) often does not. Combine it with a wait loop for a robust readiness gate.

Key takeaways

  • ss -tlnp lists listening sockets and owning processes.
  • It is faster than netstat and usually preinstalled (iproute2).
  • Prefer ss over netstat on modern CI images.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →