Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 741 Bytes

README.md

File metadata and controls

41 lines (32 loc) · 741 Bytes

kill-port

A MacOS terminal command to kill the process running on a given TCP port.

Usage

kill-port <PORT_NUMBER>

Setup

  1. Create a local file called "kill-port"
touch ~/kill-port
  1. Copy and paste the script from kill-port.sh into the newly created file.

  2. Make the file executable

chmod +x ~/kill-port
  1. Copy the file to /usr/local/bin

For a non-admin account:

mkdir ~/bin
mv ~/kill-port ~/bin/

Then add the following to your ~/.zshrc or ~/.bashrc file:

export PATH=$PATH:~/bin

And save and reload your configuration with: source ~/.zshrc or source ~/.bashrc

For an admin account:

sudo mv ~/kill-port /usr/local/bin/