Centos uses the netstat command to view the number of TCP connections

The netstat command is used to display network status. Using the netstat command allows you to know the network situation of the entire Linux system.
1. View the number of tcp connections command:
netstat -an |grep ‘ESTABLISHED’ |grep ‘tcp’ |wc -l

2. Command to view the number and status of TCP connections:
netstat -an|awk ‘/^tcp/{++S[$NF]}END{for (a in S)print a,S[a]}’

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.