LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-02-2007, 03:22 AM   #1
deeparo
LQ Newbie
 
Registered: Apr 2007
Posts: 2

Rep: Reputation: 0
how to know services running at which port number?


I want to the entire services running on my system along with the port number on which it is running. Used netstat -a but could not figure out the port number associated with each service.
 
Old 04-02-2007, 03:58 AM   #2
kstan
Member
 
Registered: Sep 2004
Location: Malaysia, Johor
Distribution: Dual boot MacOS X/Ubuntu 9.10
Posts: 851

Rep: Reputation: 31
netstat -nltp
 
Old 04-03-2007, 01:29 AM   #3
deeparo
LQ Newbie
 
Registered: Apr 2007
Posts: 2

Original Poster
Rep: Reputation: 0
How to release a port number from particular service. Problem text is
Service is dead but the particular port number on which it was
running is no released so if i try to run the service again it says
couldn't open udp:162 -- errno 98 ("Address already in use")
 
Old 04-03-2007, 02:53 AM   #4
igorc
Member
 
Registered: May 2005
Location: Sydney, Australia
Distribution: Ubuntu 5.04, Debian 3.1
Posts: 74

Rep: Reputation: 15
# netstat -ane | egrep ".162|Proto" -> take the value from User column (let say 29)
# ps -u 29 -> grab the PID for the process (let say 1234)
# kill -9 1234 -> kill the process that keeps that port open

-OR-

# /usr/sbin/lsof -i @localhost:162 -> grab the PID for the process (let say 1234)
# kill -9 1234

Last edited by igorc; 04-03-2007 at 03:05 AM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script to kill processes running on port number varunbihani Linux - Newbie 13 12-06-2005 08:46 AM
port number. bruse Linux - Networking 1 11-28-2005 02:13 PM
Port number.... help rajsun Programming 2 04-12-2005 09:20 AM
Port Number? Dakkar Linux - Newbie 5 11-06-2004 05:50 PM
Ip and port number Alien18 Linux - Networking 1 09-13-2004 09:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration