Create a gist now

Instantly share code, notes, and snippets.

@kumarldh /bashrc
Last active Mar 1, 2017

What would you like to do?
Some shortcuts I need in basrc
command_exists () {
type "$1" &> /dev/null ;
}
# grep always with color and line number
alias grep='grep -n --color=always'
# git
if command_exists git ; then
alias gitco='git checkout'
alias gist='git status'
alias gipu='git pull'
#git-fetch-all
alias gitfetchall='for remote in `git branch -r`; do git branch --track $remote; done; git fetch --all;vgit pull --all'
fi
# apache
if command_exists apache2 ; then
alias apacherelod='sudo service apache2 reload'
fi
# memcached
if command_exists memcached ; then
alias memdrelod='sudo service memcached restart'
fi
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# enable color support of ls and also add handy aliases, like grep
if [ "$TERM" != "dumb" ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
fi
# memcached
if command_exists youtube-dl ; then
alias youtube-dl='youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 '
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment