Use ss to list UDP sockets that are listening locally and display numeric values instead of service names.
Which command is appropriate?
ss -lun selects UDP, listening sockets, and numeric addresses and ports.
Detailed explanation
ss -lntIncorrect. It selects TCP listeners.
ss -lunCorrect. It lists numeric UDP listeners.
ss -antIncorrect. It lists all TCP sockets.
ss -sIncorrect. It displays a protocol summary.
Try it yourself
An example you can run in a temporary verification environment.
ss -lun 2>/dev/null | sed -n '1,3p' || printf '%s
' 'ss command not installed'Expected result
UDP socket一覧のheaderと、存在すれば待受endpointKey points
- -u is UDP
- -l is listening
- -n is numeric
Notes
- Environment: iproute2 ss / 読み取り専用
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Permission bit
A mode bit controlling read, write, execute, or special execution behavior.
Account state
Attributes that determine whether a password or login account can be used.
Resource limit
A per-process or per-user ceiling such as open files or process count.