Skip to content

Instantly share code, notes, and snippets.

@belion-freee
Last active May 11, 2019 12:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save belion-freee/1b86af577702ce795c4fdf9e18699f99 to your computer and use it in GitHub Desktop.
Save belion-freee/1b86af577702ce795c4fdf9e18699f99 to your computer and use it in GitHub Desktop.
useful alias and bash-function
# alias
alias d='docker'
alias dc='docker-compose'
alias h='heroku'
alias py='python3'
alias wi='which'
alias cl='clear'
alias to='touch'
alias to='source'
alias g='git'
alias hi='history'
alias bu='bundle'
alias ra='bundle exec rails'
alias ll='ls -G -la'
alias ..='cd ..'
alias -g gr='| grep --color'
alias rmi='rm -i'
alias rmf='rm -fr'
alias viz='vi ~/.zshrc'
alias sz='source ~/.zshrc'
alias vib='vi ~/.bashrc'
alias sb='source ~/.bashrc'
alias path='echo $PATH'
alias shell='echo $SHELL'
alias cons='bundle exec rails console'
alias ser='bundle exec rails server'
alias route='bundle exec rails routes'
# function
pss () {
ps aux | grep -E "PID|$1" | grep -v grep
}
gre () {
grep -E $1 -rl $2
}
db() {
case $1 in
"st") bundle exec rails db:migrate:status ;;
"up") bundle exec rails db:migrate:up VERSION=$2 ;;
"do") bundle exec rails db:migrate:down VERSION=$2 ;;
*) echo "plese give the params st, up, do " ;;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment