Created
November 2, 2012 05:54
-
-
Save ormaaj/3998967 to your computer and use it in GitHub Desktop.
bashrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/bash/bashrc | |
# | |
# This file is sourced by all *interactive* bash shells on startup, | |
# including some apparently interactive shells such as scp and rcp | |
# that can't tolerate any output. So make sure this doesn't display | |
# anything or bad things will happen ! | |
[[ $- == *i* ]] || return | |
shopt -s checkwinsize histappend extglob lastpipe globstar cmdhist lithist | |
# Change the window title of X terminals | |
case $TERM in | |
xterm*|rxvt*|Eterm|aterm|kterm|gnome*|interix) | |
PROMPT_COMMAND='printf "\E]0;%s@%s:%s\a" "$USER" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"' | |
;; | |
screen*) | |
PROMPT_COMMAND='printf "\E_%s@%s:%s\E\\" "$USER" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"' | |
esac | |
if x=$(tput colors) y=$? let 'y || x >= 8' && type -P dircolors >/dev/null; then | |
if [[ -f ~/.dir_colors ]]; then | |
eval "$(dircolors -b ~/.dir_colors)" | |
elif [[ -f /etc/DIR_COLORS ]]; then | |
eval "$(dircolors -b /etc/DIR_COLORS)" | |
fi | |
if [[ ${EUID:-$(id -u)} == 0 ]] ; then | |
PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] ' | |
else | |
PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] ' | |
fi | |
ls() { command ls --color=auto "$@"; } | |
grep() { command grep --color=auto "$@"; } | |
elif [[ ${EUID:-$(id -u)} == 0 ]]; then | |
PS1='\u@\h \W \$ ' | |
else | |
PS1='\u@\h \w \$ ' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment