Use ss to list listening TCP sockets numerically and show associated processes where permitted.
Which command is appropriate?
ss -lntp combines listening, TCP, numeric, and process-information filters.
Detailed explanation
ss -lntpCorrect. It lists numeric listening TCP sockets and process information.
ss -antIncorrect. It includes non-listening TCP sockets and omits process information.
ss -lnupIncorrect. It targets UDP sockets.
ss -sIncorrect. -s shows a summary rather than individual listeners.
Try it yourself
An example you can run in a temporary verification environment.
ss --help 2>&1 | grep -E -- '-l|--listening|-p|--processes' | head -n 4Expected result
listeningとprocessesに関するhelp行Key points
- -l is listening
- -t is TCP
- -p is process
Notes
- Environment: iproute2 ss help / socket照会のみ
- 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.