4 ms·
I made an amazing CLI utility for this! Simply add this to your .bashrc or .zshrc file: alias portkill='function killit(){kill -9 "$(lsof -t -i:$1)" &>/dev/nul
by corn13read2 3y ago
I made an amazing CLI utility for this! Simply add this to your .bashrc or .zshrc file:
alias portkill='function killit(){kill -9 "$(lsof -t -i:$1)" &>/dev/null || true};killit'
then run portkill PORT
- drchickensalad 3y agoWhy define the alias as a function instead of the whole thing as a function?
- blablablub 3y agoIt is amazing, otherwise it would just be normal