List listening Linux sockets with process details
Build a paste-ready command, then review its compatibility and effects before running it.
read-onlyno known side effects Compatibility
Operational knowledgereview due 2027-01-19
Requirementsssss must be installed and available on PATH.
Version supportss Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsNetid State Local Address:Port ProcessRepresentative successful output; values vary with the selected target and system state.
Known errorsss: command not foundss is missing or is not available on PATH.
Verifyss -lntupThe output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01ssSocket inspectorDisplays Linux socket information.
02lListeningKeeps sockets that are accepting connections.
03nNumericAvoids resolving service and host names.
06pProcessesShows the process using each socket when permitted.
The letters l, n, t, u, and p are combined in the single option -lntup.
Example output
Netid State Local Address:Port Process
udp UNCONN 127.0.0.53:53 users:(("systemd-resolve",pid=742,fd=13))
tcp LISTEN 0.0.0.0:22 users:(("sshd",pid=918,fd=3))
Illustrative output — exact values vary by system and data.
Runbooks
Official sources