General discussion

Locked

How do you determine if a port is in use?

By nhilty ·
I have run across multiple ways to check and see if a port is in use and the quickest and easist way is to run a the following netstat command. For example: if you wanted to see if port 9800 was currently in use, you would enter

netstat -an | grep 9800

Returns the following if port 9800 is already in use, in this case, an application is already listening on port 9800:
$ netstat -an | grep 9800
*.9800 *.* 0 0 49152 0 LISTEN

If the port was not in use, the following would get returned:
netstat -an | grep 9801
$

This conversation is currently closed to new comments.

0 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Back to Networks Forum
0 total posts (Page 1 of 1)  

Related Discussions

Related Forums