Find and Kill Process on Port Mac

08/04/2021
find and kill process using port
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.

Share This Post

Facebook
Pinterest
Twitter
WhatsApp
Rate this post

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 !

Want more? See our Articles section!

You May Like

Want to know how we can help your business?

Call us:

+65 91186913