Last active
May 11, 2019 12:57
-
-
Save belion-freee/1b86af577702ce795c4fdf9e18699f99 to your computer and use it in GitHub Desktop.
useful alias and bash-function
This file contains 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
# 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