Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# .bash_aliases
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias la='ls -alh'
alias lal='ls --color -alh | less -r'
alias h='history'
#strips off current comment from history so it doesn't show up
alias hg='history | head -$((`history | wc -l` - 1)) | grep -i '
#don't add same commands, h, and, exit to history list
export HISTIGNORE="&:h:exit"
export HISTCONTROL=ignoreboth
export HISTSIZE=2000
shopt -s cmdhist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment