Last active
September 26, 2016 13:17
-
-
Save kellyjandrews/cd4f21211e0d1547c22b to your computer and use it in GitHub Desktop.
Useful Bash Scripts
This file contains hidden or 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
export NVM_DIR="/Users/kellyandrews/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm | |
# Basic Aliases | |
alias rs='source ~/.bashrc' | |
alias atom='open -a Atom' | |
alias apps='cd ./apps' | |
#file specific | |
alias hosts='atom /etc/hosts' | |
alias bashedit='atom ~/.bashrc' | |
## Colorize the ls output ## | |
alias ls='ls -Gp' | |
alias ll='ls -laGp' | |
alias l.='ls -dGp .*' | |
## a quick way to get out of current directory ## | |
alias cd..='cd ..' | |
alias cd...='cd ../../../' | |
alias cd....='cd ../../../../' | |
alias cd.....='cd ../../../../' | |
## Colorize the grep command output for ease of use (good for log files)## | |
alias grep='grep --color=auto' | |
alias egrep='egrep --color=auto' | |
alias fgrep='fgrep --color=auto' | |
## Change to Apps Directory ## | |
alias apps='cd /Users/kellyjandrews/Apps' | |
# Git Aliases | |
alias clone='git clone' | |
alias co='git checkout' | |
alias gs='git status' | |
alias ga='git add' | |
alias gl='git log' | |
alias gc='git commit' | |
alias push='git push' | |
alias pull='git pull' | |
alias fetch='git fetch' | |
export PATH=/usr/local/bin:/usr/local/sbin:$PATH | |
# set colors of terminal | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
export PS1="\[\033[0;33m\]\u#> \[\033[0m\]\[\033[0;34m\]\W\[\033[0m\] \[\033[0;32m\]$(parse_git_branch)\[\033[0m\]\$ " | |
export CLICOLOR=1 | |
export TERM=xterm-256color |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment