Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I am installing hadoop on my Ubuntu system. When I start it, it reports that port 9000 is busy.

I used netstat -nlp|grep 9000 to see if such a port exists and I got this:

   tcp        0      0*               LISTEN

But how can I get the PID of the process which is holding it?

share|improve this question

2 Answers 2

up vote 31 down vote accepted

You can use netstat's -p option. You're already issuing it, but to get process information, you need to be the superuser:

$ sudo netstat -nlp | grep 80
tcp  0  0*  LISTEN  125004/nginx
share|improve this answer

Also you can use lsof utility. Need to be root.

# lsof -i :25
exim4   2799 Debian-exim    3u  IPv4   6645      0t0  TCP localhost:smtp (LISTEN)
exim4   2799 Debian-exim    4u  IPv6   6646      0t0  TCP localhost:smtp (LISTEN)
share|improve this answer
Without root, this will only be able to show you processes under your current user: –  Chris Down Dec 25 '13 at 7:44
This command will also give you processes with established connections, not just processes that are listening. –  firelynx Aug 18 at 10:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.