Display locally listening UDP sockets.
Do not resolve names; show addresses and ports numerically.
Which command is appropriate?
ss -lun limits the output to listening UDP sockets and displays numeric addresses and ports.
Detailed explanation
ss -lntIncorrect. It displays listening TCP sockets.
Incorrect. It displays listening TCP sockets.
ss -antIncorrect. It displays all TCP sockets.
Incorrect. It displays all TCP sockets.
ss -lxpIncorrect. It targets listening UNIX sockets and process information.
Incorrect. It targets listening UNIX sockets and process information.
ss -lunCorrect. It combines listening, UDP, and numeric filters.
Correct. It combines listening, UDP, and numeric filters.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' '-l=listening' '-u=UDP' '-n=numeric'Expected result
-l=listening
-u=UDP
-n=numericKey points
- -u means UDP
- -l limits to listening
- -n avoids reverse lookup
Notes
- Environment: option対応表の表示のみ
- 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.