Skip to content

Instantly share code, notes, and snippets.

@kumarldh
Last active March 1, 2017 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kumarldh/5bdaed3376f9b909b067 to your computer and use it in GitHub Desktop.
Save kumarldh/5bdaed3376f9b909b067 to your computer and use it in GitHub Desktop.
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