Skip to content

Instantly share code, notes, and snippets.

@Sunny-unik
Last active September 18, 2023 17:17
Show Gist options
  • Save Sunny-unik/5fd9bcfd8b4156e0c400f86f453dd1f4 to your computer and use it in GitHub Desktop.
Save Sunny-unik/5fd9bcfd8b4156e0c400f86f453dd1f4 to your computer and use it in GitHub Desktop.
Bash utility functions & aliases
# self made functions
killPortFunction() {
if [ -z "$1" ]; then
echo "Usage: killPort <port>"
return 1
fi
echo "Killing process on port $1"
sudo kill -9 $(sudo lsof -t -i:$1)
}
# some more aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias h-search='history | grep $p'
alias n-watch='npm run watch'
alias n-dev='npm run dev'
alias kill-port='killPortFunction'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment