Skip to content

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

Notifications You must be signed in to change notification settings

JacobThwaites/kill-port

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

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/

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages