Skip to content

Instantly share code, notes, and snippets.

@ghostrydr
Last active February 17, 2026 17:33
Show Gist options
  • Select an option

  • Save ghostrydr/13d06b4e8e1a83b157ded90f2c5f2355 to your computer and use it in GitHub Desktop.

Select an option

Save ghostrydr/13d06b4e8e1a83b157ded90f2c5f2355 to your computer and use it in GitHub Desktop.
Some terminal helper functions/aliases make make life easier
function killport() {
if [ -z $1 ]; then
echo "Usage: killport <port>"
return
fi
lsof -t -i tcp:$1 | xargs kill -9
}
function whatport() {
if [ -z $1 ]; then
echo "Usage: whatport <port>"
return
fi
lsof -i tcp:$1 | grep 'LISTEN' | awk '{print $2}' | xargs ps -fp | awk '{ print $9 }'
}
# Git
alias status='git status'
alias fetch='git fetch'
alias pull='git pull'
alias push='git push'
alias stash='git stash'
alias pop='git stash pop'
alias abort='git reset --merge'
alias mm='git merge master'
alias checkout='git checkout $@'
alias branch='git checkout -b $@'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment