View port usage and kill process under Mac

Source: Internet
Author: User

When eclipse is on run server, Tomcat is on, but the error shows that 8080, 8005, and 8009 ports are occupied

Terminal input

To view all open ports

sudo lsof-i-P | Grep-i "Listen"

Appears as follows

HTTPD Root 4u IPv6 0xbc257c1a68e3d681 0t0 TCP *:80 (LISTEN)

Mysqld _mysql 30u IPv6 0xbc257c1a68e3d121 0t0 TCP *:3306 (LISTEN)

HTTPD 277 _www 4u IPv6 0xbc257c1a68e3d681 0t0 TCP *:80 (LISTEN)

ADB 673 Wangchunqian 7u IPv4 0xbc257c1a7972ea39 0t0 TCP localhost:5037 (LISTEN)

Alipaydis 2154 Root 16u IPv4 0xbc257c1a8440f341 0t0 TCP localhost:27382 (LISTEN)

Java 8900 root 48u IPv6 0xbc257c1a68e3dbe1 0t0 TCP *:8080 (LISTEN)

Java 8900 root 49u IPv6 0xbc257c1a73b70121 0t0 TCP *:8009 (LISTEN)

Java 8900 root 56u IPv6 0xbc257c1a68e3cbc1 0t0 TCP localhost:8005 (LISTEN)

Office365 8916 Wangchunqian 5u IPv4 0xbc257c1a6f146c49 0t0 TCP localhost:1538 (LISTEN)

Where the second column is the PID

Then according to the PID kill process:

sudo kill-9 8900

Rerun run on server ok

View port usage and kill process under Mac

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.