The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to check that a device is attached on a port narendra.pant SUN Solaris 2 07-15-2008 11:47 PM
how to check status of various services and port? ashish4422 AIX 1 04-16-2008 02:14 PM
How to check the TCP/UDP port of a connection tayyabq8 UNIX for Dummies Questions & Answers 2 05-18-2006 12:55 AM
How can I check what port addresses used the application eykyn17 IP Networking 1 02-16-2006 12:58 PM
how can i check if port is busy or if someone is using it ? umen IP Networking 1 01-28-2006 03:37 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-11-2009
rajesh08 rajesh08 is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 14
How do you check whether a port currently being used?

Hi,

Please help me out, how to check whether a port currently being used or not.
is there any command which give the result?

Thanks
Rajesh
  #2 (permalink)  
Old 03-11-2009
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,257
You can check it with netstat -a and search for either port name associated with /etc/services or just the portnumber if it is not listed in /etc/services.
You can see stati like ESTABLISHED and others.

To check remote if a port is available or not, you can use nmap. It doesn't say if this port is currently being used though. Just have a loot at it as additional info
  #3 (permalink)  
Old 03-11-2009
Autocross.US's Avatar
Autocross.US Autocross.US is offline
Registered User
  
 

Join Date: Nov 2008
Location: Chesapeake, VA
Posts: 73
lsof -i :<portnumber>

example:

lsof -i :80
  #4 (permalink)  
Old 03-11-2009
vbe's Avatar
vbe vbe is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2005
Location: Switzerland - GE
Posts: 1,546
lsof isnt a unix command... but a opensource utility that might not be installed...
  #5 (permalink)  
Old 03-13-2009
amitranjansahu's Avatar
amitranjansahu amitranjansahu is offline
Registered User
  
 

Join Date: Jan 2009
Location: Gurgaon,INDIA
Posts: 239
netstat -an | grep <port number>

ex -
netstat -an | grep 5060
  #6 (permalink)  
Old 05-13-2009
sikander sikander is offline
Registered User
  
 

Join Date: May 2009
Posts: 3
ports and services

Hi All,

Can some guide me how can i check this 49152 port or any port is used by which service and how can I block it.

Thanks in advance. Looking forward to hear from you guys.

Regards,

Sikander
  #7 (permalink)  
Old 05-13-2009
zaxxon's Avatar
zaxxon zaxxon is offline Forum Staff  
Moderator
  
 

Join Date: Sep 2007
Location: Germany
Posts: 2,257
Hi, please open a new thread next time instead of digging out this old one.

There is some information to your question already in this thread.
If you don't have an entry in your /etc/services, you can try with the command (if available) "lsof" if you can see what uses this port. Also you can check with netstat -a for example if it is up and what status it has.
For blocking ports you might want to use a firewall; depending on your system on Linux you could use ipchains/iptables.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 09:53 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0