Tuesday, February 2, 2010

Display Open Ports

Hi All,

Many a times - when you are working on multiple projects and in an environment - where many of the developers are using the same unix boxes - then we need to know - what are the ports in use - say for example for Jboss or Tomcat...

If you have enough experience working on Jboss and Tomcat - once you mention a port for your server to start up - the next 20 slots [I call it numbers only] are utilised by your servers.

There is a command in Unix - called lsof

This lsof - has one good option -i

The option -i lists the open internet -ip4 and ip6 protocol ports or files or for the -i internet address option.

If you read the man pages and in particular for the -i option - you will find this below:

This option selects the listing of files any of whose Internet address matches the address specified in i. If no address is specified, this option selects the listing of all Internet
and x.25 (HP-UX) network files.

Hope this of some help to you folks....

Cheers :)
Ananth Gouri

No comments:

Post a Comment