Last active
October 25, 2021 12:14
-
-
Save Kenan7/a410f24fa3d047b78c2e780f334be705 to your computer and use it in GitHub Desktop.
Little tools and aliases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function find-and-kill() { | |
# find the process id given port number | |
# $1 is the port number | |
# get the process id | |
pid=$(sudo lsof -i :$1 -t) | |
echo "Killing process id -> $pid" | |
sudo kill -9 $pid | |
echo "Done ✔️" | |
} | |
alias fk="find-and-kill" | |
# usage -> fk 50052 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment