bash history

I prefer bash as shell. It is very good to have the time and date for a command in history, especially for root.

and when you are logged in as root the prompt is red, and blue for normal users.

put this in your .bash_profile and in root’s .bash_profile

export HISTCONTROL=ignoredups
export HISTFILE=$HOME/.bash_history
export HISTFILESIZE=5000
export HISTIGNORE=
export HISTSIZE=2000
export HISTTIMEFORMAT="%a %b %Y %T %z "
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01m\][ \[\033[01;31m\]\u@\h \[\033[00m\]\[\033[01m\]] \[\033[01;32m\]\w\[\033[00m\]\[\033[01;31m\]#\[\033[00m\]> '
else
PS1='\[\033[01m\][ \[\033[01;34m\]\u@\h \[\033[00m\]\[\033[01m\]] \[\033[01;32m\]\w\[\033[00m\]\[\033[01;34m\]$\[\033[00m\]> '
fi
Published
Categorized as Linux

Leave a comment

Your email address will not be published. Required fields are marked *