Skip to content

Instantly share code, notes, and snippets.

@kumarldh 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'
alias gitfetchall='for remote in `git branch -r`; do git branch --track $remote; done; git fetch --all;vgit pull --all'
# apache
if command_exists apache2 ; then
alias apacherelod='sudo service apache2 reload'
# memcached
if command_exists memcached ; then
alias memdrelod='sudo service memcached restart'
# 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'
# memcached
if command_exists youtube-dl ; then
alias youtube-dl='youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.