Linux command
systemctl-list-sockets 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Example
systemctl list-sockets
Example
systemctl list-sockets --show-types
Example
systemctl list-sockets -a
Example
systemctl list-sockets --state [active|inactive|failed]
Example
systemctl list-sockets [pattern]
说明
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.
参数
- -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
FAQ
What is the systemctl-list-sockets command used for?
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.
How do I run a basic systemctl-list-sockets example?
Run `systemctl list-sockets` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -a, --all do in systemctl-list-sockets?
Include inactive and failed socket units