LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-22-2010, 08:24 PM   #1
L1nuxn00b703
Member
 
Registered: Sep 2009
Posts: 117

Rep: Reputation: 15
how to check all open TCP connections


Hi all,
What is the command to check all open TCP connections?? Thanks.
 
Old 02-22-2010, 08:42 PM   #2
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

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

Code:
$ netstat -a
Good luck. ;-)

Last edited by Peacedog; 02-22-2010 at 10:24 PM.
 
Old 02-22-2010, 09:51 PM   #3
throughthegreens
Member
 
Registered: Feb 2010
Location: Asekhshinuv Sacramento,Ca
Distribution: Slackware 13.0
Posts: 35

Rep: Reputation: 16
netstat -anp --tcp --udp will show you all open tcp and udp connections. do not specify --udp and it will show you just tcp
 
Old 02-22-2010, 10:25 PM   #4
Peacedog
LQ Guru
 
Registered: Sep 2003
Location: Danville, VA
Distribution: Slackware, Windows, FreeBSD, OpenBSD, Mac OS X
Posts: 5,296

Rep: Reputation: 168Reputation: 168
Quote:
Originally Posted by throughthegreens View Post
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!
 
Old 02-22-2010, 11:28 PM   #5
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

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

To additionally get the associated PID for each connection, use:
# netstat -tnp
 
Old 02-23-2010, 01:31 AM   #6
L1nuxn00b703
Member
 
Registered: Sep 2009
Posts: 117

Original Poster
Rep: Reputation: 15
Thanks all!!!
 
Old 04-23-2010, 04:32 AM   #7
nkyuvarajan
LQ Newbie
 
Registered: Apr 2010
Posts: 2

Rep: Reputation: 0
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?
 
Old 04-23-2010, 04:33 AM   #8
nkyuvarajan
LQ Newbie
 
Registered: Apr 2010
Posts: 2

Rep: Reputation: 0
how to check all open TCP connections for a particular machine?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
tcp/ip buffer, how to check check actual size japotemp Linux - Newbie 2 01-23-2009 07:17 AM
iptables doesn't seem to apply new rules to already open TCP connections Ahmed_Baghdad Linux - Networking 2 09-27-2007 03:06 AM
how to view how many tcp connections open? FireRaven Linux - Networking 3 01-02-2007 05:00 AM
Woody 3.0 Open Ports 1470/tcp/uaiact 1518/tcp/vpvd What for?How can I remove them? alexxxis Debian 5 07-05-2004 06:18 PM
half-open tcp connections r_m_carlsson Linux - Networking 1 02-03-2004 06:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration