标签:高亮 history image http rom bash mic log debian
更新centos PS1 高亮显示,更加友好的显示,以及提示关键信息,命令记录与存储,切换目录自动显示路径PS1展示:
history展示:
代码
file : /etc/bashrc
PS1="[${debian_chroot:+($debian_chroot)}\T - [\e[35m]\u[\e[m]@hostname
- hostname -I|awk ‘{print $1}‘
[\e[31m]\w[\e[m]]\$ "
export USER_IP=who -u am i 2>/dev/null| awk ‘{print $NF}‘|sed -e ‘s/[()]//g‘
export HISTTIMEFORMAT="[%F %T][whoami
][${USER_IP}] "
export PROMPT_COMMAND=‘{ msg=$(history 1 | { read x y; echo $y; });user=$(whoami); echo $(date "+%Y-%m-%d %H:%M:%S"):$user:pwd
/:$msg ---- $(who am i); } >> /tmp/date +%F
-hostname
-whoami
-history.log‘
alias cd=‘cdp(){ cd $1;pwd;};cdp‘
更新centos PS1 高亮显示,更加友好的显示,以及提示关键信息,命令记录与存储,切换目录自动显
标签:高亮 history image http rom bash mic log debian
原文地址:https://blog.51cto.com/amunlinux/2529144