hi,
can any one please tell me, if I want to check that if any particular port on a remote workstation is open or closed on a LAN which command should I use ? If the ping command can be used please tell me its syntax.

regards
pdwivedi

Use either or both of these commands to find out if a port is already taken by a service:

netstat -A inet -lnp

lsof -i tcp:the_port_you_are_inquiring_about

For example, if I wan to know if port 8080 is already taken, I do:

netstat -A inte -lnp
I then search on the output to see if a service is already listening on port 8080.

I also use the other one:

lsof -i tcp:8080

If you get a response, then another service is listening on port 8080 and you cannot use it.
However, if you get no response, then it is free to use. No service is listening on port 8080.

Thanks.
--Willie

or you can simply use nmap

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.