Skip to Content
Back to Shortcutie

Updated

How to Kill the Process on a Port on Mac

With Shortcutie

Terminal is the fast way for most developers. A shortcut is better when you do this often, or do not want to open Terminal:

  1. Install Shortcutie, and open it once.
  2. In the Shortcuts app, click the add button to make a new shortcut.
  3. Add the “Kill Process” action of Shortcutie. Keep “Port Number” in “Kill By”.
  4. Click the port number field, and type the port, like 3000. To choose the port each time, Control-click the field, and choose “Ask Each Time”.
  5. Run the shortcut. The result is the number of processes that it stopped.

Tips

  • To see what uses a port before you stop it, use the “Find Listening Port” action, which gives the listening ports of your Mac. To only count the processes that the action would stop, turn on “Dry Run”.
  • The action asks the process to quit. Turn on “Force Kill” for a process that does not respond.
  • “Kill By” can also be “Process Name” or “Process ID”.
  • To run the shortcut in one click, put it in the menu bar.

Get Shortcutie

Power up the Shortcuts app on Mac

$10, one-time purchase, plus tax where applicable

Platform
macOS
Requires
macOS 26 or later
Released
February 2025
Updated
September 2026
Version
1.8.1
Size
9 MB
Gumroad rating
4.9/5 (26 ratings)

More about Shortcutie

Without an app

macOS has the tools in the Terminal app:

  1. Open the Terminal app, and run lsof -i tcp:3000 -sTCP:LISTEN, with your port number. It shows only the process that listens on the port, not the apps that are connected to it, like a browser. The “PID” column shows the number of the process, and “COMMAND” shows its name.
  2. Run kill with the PID, like kill 12345.
  3. If the process does not stop, run kill -9 12345. This stops it immediately, and it cannot save its data.

To do both in one command:

console
kill $(lsof -ti tcp:3000 -sTCP:LISTEN)

This is the fast way when Terminal is already open, like for a development server that did not stop.

You can also stop a process in Activity Monitor: select the processes, and click the (x) button in the toolbar. But Activity Monitor does not show which process uses a port, so you must first get its name with lsof.