List systemd socket units, their listening addresses, and the services they activate.
Do not change units.
Which command is appropriate?
systemctl list-sockets displays socket units, listen endpoints, and activation targets, revealing listeners that may remain after stopping only a service.
Detailed explanation
systemctl list-servicesIncorrect. It is not the standard systemctl subcommand for sockets.
Incorrect. It is not the standard systemctl subcommand for sockets.
systemctl list-socketsCorrect. It lists socket units and their activation targets.
Correct. It lists socket units and their activation targets.
systemctl socket-statusIncorrect. This is not a standard systemctl subcommand.
Incorrect. This is not a standard systemctl subcommand.
systemctl show-portsIncorrect. There is no standard show-ports subcommand.
Incorrect. There is no standard show-ports subcommand.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'systemctl list-sockets -> socket units, LISTEN endpoints, ACTIVATES services'Expected result
systemctl list-sockets -> socket units, LISTEN endpoints, ACTIVATES servicesKey points
- Audit socket units
- Check LISTEN endpoints
- Check ACTIVATES targets
Notes
- Environment: systemctl構文対応表
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.