It is a general command to check which program is using port 80. And also known the PID of this process. Then to force stop it and release the port 80 to other program.


root@ubuntu:~# lsof -i:80
COMMAND   PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
apache2  1314     root    4u  IPv6   9663      0t0  TCP *:http (LISTEN)
apache2  2582 www-data    4u  IPv6   9663      0t0  TCP *:http (LISTEN)
apache2  4464 www-data    4u  IPv6   9663      0t0  TCP *:http (LISTEN)
apache2  9980 www-data    4u  IPv6   9663      0t0  TCP *:http (LISTEN)
apache2  9982 www-data    4u  IPv6   9663      0t0  TCP *:http (LISTEN)
apache2 10120 www-data    4u  IPv6   9663      0t0  TCP *:http (LISTEN)
apache2 10147 www-data    4u  IPv6   9663      0t0  TCP *:http (LISTEN)
apache2 10282 www-data    4u  IPv6   9663      0t0  TCP *:http (LISTEN)
apache2 10283 www-data    4u  IPv6   9663      0t0  TCP *:http (LISTEN)
apache2 10543 www-data    4u  IPv6   9663      0t0  TCP *:http (LISTEN)
apache2 10544 www-data    4u  IPv6   9663      0t0  TCP *:http (LISTEN)

 

2014-07-29_143727

To get more details of how to use command lsof, enter lsof –help to get the help.

 

David Yin

David is a blogger, geek, and web developer — founder of FreeInOutBoard.com. If you like his post, you can say thank you here

Leave a Reply

Your email address will not be published. Required fields are marked *