Skip to content

Instantly share code, notes, and snippets.

@Kenan7
Last active October 25, 2021 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kenan7/a410f24fa3d047b78c2e780f334be705 to your computer and use it in GitHub Desktop.
Save Kenan7/a410f24fa3d047b78c2e780f334be705 to your computer and use it in GitHub Desktop.
Little tools and aliases
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