# /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 !
if [[ ${EUID} == 0 ]] ; then
PS1="\n\[\033[35m\]\$(tail -n 1 /var/log/messages)\n\[\033[32m\]\w\n\[\033[1;31m\]\u@\h: \[\033[1;34m\]\$(/usr/bin/tty | /bin/sed -e 's:/dev/::'): \[\033[1;36m\]\$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed 's: ::g') files \[\033[1;33m\]\$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')b\[\033[0m\] -> \[\033[0m\]"
else
PS1="\n\[\033[35m\]\$(tail -n 1 /var/log/messages)\n\[\033[32m\]\w\n\[\033[1;32m\]\u@\h: \[\033[1;34m\]\$(/usr/bin/tty | /bin/sed -e 's:/dev/::'): \[\033[1;36m\]\$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed 's: ::g') files \[\033[1;33m\]\$(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')b\[\033[0m\] -> \[\033[0m\]"
fi
# Test for an interactive shell. There is no need to set anything
# past this point for scp and rcp, and it's important to refrain from
# outputting anything in those cases.
if [[ $- != *i* ]] ; then
# Shell is non-interactive. Be done now!
return
fi
# Bash won't get SIGWINCH if another process is in the foreground.
# Enable checkwinsize so that bash will check the terminal size when
# it regains control. #65623
# http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
shopt -s checkwinsize
# Set colorful PS1 only on colorful terminals.
# dircolors --print-database uses its own built-in database
# instead of using /etc/DIR_COLORS. Try to use the external file
# first to take advantage of user additions.
use_color=false
safe_term=${TERM//[^[:alnum:]]/.} # sanitize TERM
if [[ -f /etc/DIR_COLORS ]] ; then
grep -q "^TERM ${safe_term}" /etc/DIR_COLORS && use_color=true
elif type -p dircolors >/dev/null ; then
if dircolors --print-database | grep -q "^TERM ${safe_term}" ; then
use_color=true
fi
fi
if ${use_color} ; then
if [[ ${EUID} == 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
#alias ls='ls --color=auto'
alias ls="ls -C -h -X --color=always --" #-a pour les cacher
else
if [[ ${EUID} == 0 ]] ; then
# show root@ when we don't have colors
PS1='\u@\h \W \$ '
else
PS1='\u@\h \w \$ '
fi
fi
##alias
alias nano="nano -w"
alias du="du -h"
alias df="df -h"
alias update="emerge -vauD world"
#alias d="ls --color"
#alias ll="ls --color -l"
alias emerge="emerge -va"
alias rmv="emerge -C"
alias nano="nano -w"
alias bashrc="nano /etc/bash/bashrc"
alias h="history | tail"
#alias screen="screen -U"
alias quota="quota -s"
alias cp="cp -g"
alias mv="mv -g"
alias rm="rm -v"
alias cache="CCACHE_DIR="/var/tmp/ccache/" ccache -s"
alias ipupdate="date >> /var/log/dynhost.log; ipcheck.py -v -a `wget -O - www.whatismyip.com -q | grep -i your | grep "<h1" | cut -d" " -f4 | cut -d"<" -f1` LC6666-OVH salta95 gounlaf.com >> /var/log/dynhost.log"
alias dynlog="dog /var/log/dynhost.log"
alias listeliens="ls -F | grep @$ | gawk -F@ '{print $1}'"
alias uptimeproject="yasuc"
alias reemerge="equery -nc -I | sort | uniq | NOCOLOR=true xargs emerge 2>&1 >qpkg-make.log"
alias log="tail -f /var/log/messages /var/log/apache2/access_log"