Find and Kill Process on Port Mac

In this article:
Command to find process and kill process using specific port. Process using the port can be found and killed to release the port. Search port.

Introduction

One would ask how to find and kill process on port on their Mac? Many times while developing an application, you would face the issue whereby some other processes are using the port which you require for development.

Commands to Find and Kill Process on Port Mac

The below commands find the process using port 3000 (localhost) and kills the process.

Find Process Using Port on Mac

This command finds all the processes using the port stated (e.g. 3000) and returns the Process ID.

sudo lsof -iTCP -sTCP:LISTEN -P | grep :3000

Kill Process Using Port on Mac

This command stops the process using the Process ID provided so that the port is released and can be used.

kill -9 <Process ID>

Frequently Asked Questions

How to find a process using a port on a Mac?

Use the command “sudo lsof -iTCP -sTCP:LISTEN -P | grep :<Port Number>”.

How to kill a process using a port on a Mac?

Use the command “kill -9 <Process ID>”

Have any other questions? Leave it down in the comments below or contact us !

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on whatsapp
WhatsApp

Leave a Reply

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

Post comment

Share this post

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on whatsapp
WhatsApp

Recent articles

Featured articles