把如下命令加到 /root/.bashrc即可

export PS1="[\u@hostname \W]\\$"
alias grep='grep –color'
datestamp_history(){
export infodate=`date "+: %c"`
export infohis=`history 1`
echo $infodate' => '$infohis >> $HOME/.history-temp
}
export PROMPT_COMMAND=datestamp_history
export LANG=C