Main Tutorials

Mac OSX – What program is using port 80

In Mac OSX, you can use sudo lsof -i :80 to find out what program is using or listening on port 80 :

In terminal


$ sudo lsof -i :80

Password:
COMMAND     PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
httpd     12649   root    5u  IPv6 0xede4ca21f607010b      0t0  TCP *:http (LISTEN)
httpd     12650   _www    5u  IPv6 0xede4ca21f607010b      0t0  TCP *:http (LISTEN)
httpd     12653   _www    5u  IPv6 0xede4ca21f607010b      0t0  TCP *:http (LISTEN)

To know the PID detail :


$ ps u 12649
USER   PID  %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
root 12649   0.0  0.0  2463084   4020   ??  Ss    5:40PM   0:00.21 /usr/sbin/httpd -D FOREGROUND

$ ps u 12650
USER   PID  %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
_www 12650   0.0  0.0  2463084   1580   ??  S     5:40PM   0:00.01 /usr/sbin/httpd -D FOREGROUND 

This /usr/sbin/httpd is listening on port 80, should be Apache server.

P.S Tested on Mac OSX Yosemite, v10.10

References

  1. Wikipedia : Lsof
  2. Wikipedia : PS in Unix

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
2 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Bhavani
6 years ago

How can I kill that process?
I tried multiple ways but did not work

yuankui
9 years ago

thanks!