LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to check all open TCP connections (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-check-all-open-tcp-connections-790895/)

L1nuxn00b703 02-22-2010 07:24 PM

how to check all open TCP connections
 
Hi all,
What is the command to check all open TCP connections?? Thanks.

Peacedog 02-22-2010 07:42 PM

Hi L1nuxn00b703, Welcome to LQ. There may be a better way, but this should do for now.

Code:

$ netstat -a
Good luck. ;-)

throughthegreens 02-22-2010 08:51 PM

netstat -anp --tcp --udp will show you all open tcp and udp connections. do not specify --udp and it will show you just tcp

Peacedog 02-22-2010 09:25 PM

Quote:

Originally Posted by throughthegreens (Post 3873324)
netstat -anp --tcp --udp will show you all open tcp and udp connections. do not specify --udp and it will show you just tcp

I knew there was a better way! :D

anomie 02-22-2010 10:28 PM

For open (established) tcp connections, try:
# netstat -tn

To additionally get the associated PID for each connection, use:
# netstat -tnp

L1nuxn00b703 02-23-2010 12:31 AM

Thanks all!!!

nkyuvarajan 04-23-2010 03:32 AM

No of TCP connections
 
how to check/measure all open TCP connections for a particular machine using its IP address?
and
can anyone send me the code to calculate/find the num of tcp connections?

nkyuvarajan 04-23-2010 03:33 AM

how to check all open TCP connections for a particular machine?


All times are GMT -5. The time now is 03:43 PM.