How to check for free ports on Linux Box

Robert Anderson riznob at gmail.com
Wed Sep 20 17:39:04 UTC 2006


On 9/20/06, Bruno Wolff III <bruno at wolff.to> wrote:
>
> On Wed, Sep 20, 2006 at 15:50:38 +0530,
> Kaushal Shriyan <kaushalshriyan at gmail.com> wrote:
> >
> > I need my apache web server to listen to a particular port, On my box
> > there are 100 of applications which uses port to run
> >
> > My Query is how do i check for FREE PORTS on my box, is there any
> > utility where i can find FREE Ports and use it for my application(Apache
> Web
> > Server)
>
> This doesn't make much sense. If you need apache to listen on a particular
> port then it needs to listen on that port and there isn't any reason to
> be checking other ports.
> What you might want to do is see if anything else on the system is using
> that port. Looking at /etc/services is a quick way to look for potential
> conflicts. It will tell which ports are typically used by which services.
> You can also run netstat and look for sockets in a LISTEN state to see
> which
> ones are actually being used on your system at a given time.
>
> --
> fedora-list mailing list
> fedora-list at redhat.com
> To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
>

The following will show you what ports are currently in use...

netstat -a

You probably want to grep the output for the port you are interested in. If
the port is not listed, it is not in use.

-- 
Rob Anderson
riznob at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20060920/195e9ce5/attachment-0001.htm>


More information about the fedora-list mailing list