Re: How can I find out if a port is available on linux



On Jul 5, 12:42 pm, "silverburgh.me...@xxxxxxxxx"
<silverburgh.me...@xxxxxxxxx> wrote:
Hi,

How can I find out if a port is available on linux?
One thing i can do is to open() and then close() a port number.
I wonder if there is a more efficient way?

Thank you.

Run: netstat -atnp|grep LISTEN

It will show you the ports already in use. A quick way to tell if a
tcp port is free is to just 'telnet localhost XXXX' where XXXX is the
port. Connection refused means (usually) nothing is listening there.

.



Relevant Pages

  • Re: Best Plan of action for 2 forest.......
    ... PortQry reports the status of a port in one of the following ways: ... ..LISTENING This response indicates that a process is listening on the target ...
    (microsoft.public.windows.server.active_directory)
  • changed port
    ... I have an app which is listening specific port for incoming ... I run it on AIX,HPUX, Solaris it all worked fine, but on linux (RH ...
    (comp.os.linux.networking)
  • Re: RealVNC
    ... If we are talking about RealVNC it goes this way ... Then there is default Java listening port on port 5800 on the client machine ...
    (microsoft.public.windows.server.sbs)
  • Re: Closing all ports on Linux
    ... >> to listen to port 25, but I want to keep the ... Is there any file in Linux ... >> I don't want iptable solutions. ... listening on a socket). ...
    (comp.os.linux.networking)
  • Re: Cant join a domain
    ... Attempting to resolve name to IP address... ... TCP port 42: NOT LISTENING ...
    (microsoft.public.windows.server.active_directory)