List established TCP connections without DNS lookups
Build a paste-ready command, then review its compatibility and effects before running it.
netstat -tn | awk '$6=="ESTABLISHED"'read-onlyno known side effects Compatibility
LinuxVerified for Linux using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementsnetstatnetstat must be installed and available on PATH.
Version supportnetstat Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalstcp 0 0 10.0.0.12:22 203.0.113.42:51128 ESTABLISHEDRepresentative successful output; values vary with the selected target and system state.
Known errorsnetstat: command not foundnetstat is missing or is not available on PATH.
Verifynetstat -tn | awk '$6=="ESTABLISHED"'The 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
01netstatCommandRuns the netstat stage of this one-liner.
02-tnOptionDisplays TCP sockets numerically without resolving hostnames or service names.
03|PipelinePasses the output on the left to the command on the right.
04awkCommandRuns the awk stage of this one-liner.
05'$6=="ESTABLISHED"'ArgumentPasses '$6=="ESTABLISHED"' to awk.
Example input
netstat -tn | awk '$6=="ESTABLISHED"'
Example output
tcp 0 0 10.0.0.12:22 203.0.113.42:51128 ESTABLISHED
tcp 0 0 10.0.0.12:443 198.51.100.17:60244 ESTABLISHED
Illustrative output — exact values vary by system and data.
Official sources
Related commands