Use Netstat to check if a port is listening

I should have put this handy long time ago.  There is situation that we need to know if a special port on a server is listening, then we can see if need to open firewall, etc.  So the command netstat is our friend.

Simple way to use netstat is:

>netstat –ano | more

It will show all the listening ports in numerical form, and the process ID that is listening.

Another way is use find:

>netstat –an | find “:3389”
TCP    0.0.0.0:1367           0.0.0.0:0              LISTENING

I will add some Linux command later.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s