NOTE

netstat

These notes record netstat commands for inspecting TCP connections and counting connections by state.

Operating Systems / LinuxCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. View TCP Connections

netstat -antp

2. Count TCP Connections by State

netstat -antp |grep "target server port"|awk '/tcp/ {print $6}' |sort|uniq -c

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub