It is a simple kill port script. When you run an app using maybe npm run dev and you want to close it. On some device it will close the process but the port will still be in use. This small script helps the user to kill the service completely making sure this port is ready and available to use again.
.
βββ LICENSE
βββ kill-port.sh
- Clone the this repo main branch to your desktop.
- Open the folder and use this command to make the .sh exec.
chmod +x kill-port.sh - Link this folder to your .zshrc. This is mainly located in ~/.zshrc
- Use nano or vim to edit .zshrc
- Add the line to your .zshrc :
export PATH="$PATH:{folder}/kill-port" - Replace {folder} with the correct path to this project
Once setup, write source .zshrc to apply the new changes
On your terminal, you can use it like below
kill-port.sh -p 1234
This will list all the service listening on this port
Write the PID number and it will ask for your password. This will kill the port and you can use it for another services.
Contributions are welcome! Here's how you can help:
- Fork the repository
- Clone your fork:
git clone https://github.com/shumatics/kill-port.git - Create a new branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -am 'Add some feature' - Push to your branch:
git push origin feature/your-feature - Open a pull request
Please ensure your code follows the project's style guidelines and includes tests where applicable.
This project is licensed under the LICENSE License.