enquiring the status of a port

Reply

Join Date: Oct 2007
Posts: 29
Reputation: pdwivedi is an unknown quantity at this point 
Solved Threads: 0
pdwivedi pdwivedi is offline Offline
Light Poster

enquiring the status of a port

 
0
  #1
Jul 12th, 2008
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
Regards
Prashant
Reply With Quote Quick reply to this message  
Join Date: Jan 2008
Posts: 40
Reputation: williebens is an unknown quantity at this point 
Solved Threads: 0
williebens williebens is offline Offline
Light Poster

Re: enquiring the status of a port

 
0
  #2
Jul 15th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 1,765
Reputation: DimaYasny will become famous soon enough DimaYasny will become famous soon enough 
Solved Threads: 85
Moderator
Featured Poster
DimaYasny DimaYasny is offline Offline
Posting Virtuoso

Re: enquiring the status of a port

 
0
  #3
Jul 23rd, 2008
or you can simply use nmap
Real stupidity always beats Artificial Intelligence. (Terry Pratchett)

BA BizMg, MCSE, DCSE, Linux+, Network+
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Linux Servers and Apache Forum
Thread Tools Search this Thread



Tag cloud for Linux Servers and Apache
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC