LinuxCommandLibrary

systemctl-list-sockets

List socket-activated units

TLDR

List active socket units

$ systemctl list-sockets
copy
Show socket types
$ systemctl list-sockets --show-types
copy
List all including inactive
$ systemctl list-sockets -a
copy
Filter by state
$ systemctl list-sockets --state [active|inactive|failed]
copy
Filter by pattern
$ systemctl list-sockets [pattern]
copy

SYNOPSIS

systemctl list-sockets [OPTIONS] [PATTERN...]

DESCRIPTION

systemctl list-sockets displays socket units currently active in memory, ordered by listening address. Socket units implement socket activation, where services are started on-demand when connections arrive.
The output shows the listening address (IP:port, path, etc.), the socket unit name, and the unit it activates.

PARAMETERS

-a, --all

Include inactive and failed socket units
--state= STATE
Filter by state
--show-types
Display socket types (Stream, Datagram, etc.)
--no-legend
Suppress header and footer
--no-pager
Disable pager

CAVEATS

Shows systemd-managed sockets only, not all listening sockets on the system. Use `ss` or `netstat` for a complete list. Socket activation may cause startup delays on first connection.

HISTORY

The list-sockets subcommand provides insight into systemd's socket activation infrastructure, which reduces memory usage by starting services only when needed.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community