Skip to content

Instantly share code, notes, and snippets.

@bubbobne
Created July 11, 2017 08:07
Show Gist options
  • Save bubbobne/05b12303b71441c25d41a2a3310d63c7 to your computer and use it in GitHub Desktop.
Save bubbobne/05b12303b71441c25d41a2a3310d63c7 to your computer and use it in GitHub Desktop.
bash color e alias
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
#
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
#
case "$TERM" in
xterm-color)
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
;;
*)
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;36m\][\t]\[\033[00m\]\[\033[01;32m\]\u@:\[\033[00m\]\[\033[01;34m\]\w\[\033[00m\]\[\033[01;31m\][\!] \$ \[\033[00m\]\[\033[01;35m\]'
;;
esac
case "$TERM" in
xterm*|rxvt*)\
PROMPT_COMMAND='echo -ne "\033]0; ${PWD/$HOME/~}\007"'
;;
*)
;;
esac
# enable color support of ls and also add handy aliases
if [ "$TERM" != "dumb" ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'
fi
# some more ls aliases
alias ll='ls -lh'
alias la='ls -A'
alias l='ls -CF'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment