git clone git@github.com:sangqle/custom-command.git ~/.custom-command
cd ~/.custom-command
chmod +x killport
echo -e "\n# Custom command\nexport PATH=\$HOME/.custom-command/:\$PATH" >> ~/.zshrc
source ~/.zshrc
git clone git@github.com:sangqle/custom-command.git ~/.custom-command
cd ~/.custom-command
chmod +x killport
echo -e "\n# Custom command\nexport PATH=\$HOME/.custom-command/:\$PATH" >> ~/.bashrc
source ~/.bashrc
And then you can use killport command to kill port by port number or range of port
killport 3000 3001 3002
git clone git@github.com:sangqle/custom-command.git ~/.custom-command
cd ~/.custom-command
chmod +x <your script here>
Example for killport
chmod +x killport
// some code above
export PATH=$HOME/.custom-command/:$PATH
// some code below
Or you can one of these command below to append the source into .bashrc or .zshrc
echo -e "\n# Custom command\nexport PATH=\$HOME/.custom-command/:\$PATH" >> ~/.bashrc
echo -e "\n# Custom command\nexport PATH=\$HOME/.custom-command/:\$PATH" >> ~/.zshrc
source ~/.bashrc
source ~/.zshrc
Kill port by port number or range of port
killport 3000 3001 3002
or kill range of port
killport 3000-3002
Check port is open or not
port 3000