Ubuntu体系不少文件战窗心皆是以代码的模式显现的,那些代码外包孕了末端用户名,若是可以Ubuntu体系把末端用户名改成白色,便能够利便用户查看。原文便去引见一高Ubuntu体系把末端用户名改成白色的技巧。
因为输进特定符号会招致治码,治码局部用省略号显现,有些截图显现几个感慨号
零个操做代码流程图片战终极显现成果
输进》echo $PS1
显现:如上图
正在小我私家用户文件夹输进
输进gedit ~/.bashrc
批改那几止代码
if [ “$color_prompt” = yes ]; then
PS1=。。。。
else
PS1==。。。
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
重改为:
# if [ “$color_prompt” = yes ]; then
#PS1=‘$.。。。。。。。。。\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ’
# else
# PS1=‘$.。。。。。。。。。。。。。。。。。。。。。。。\u@\h:\w\$ ’
# fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
而后再文件的终首一止添上:
(高一止是截图)PS1=‘$.。。。。。。。。。。。。。。。。。。\033[01;31m\]\u\[\033[00m\]@\h:\w\$ ’
生存撤退退却没,而后source一高,也便是输进》source ~/.bashrc
正在root文件夹外面位置 /root也异样操做一遍。
以上是小我私家的批改。
如下是网上的参考:(再上面是截图)
customer: PS1=‘$.。。。。。。。。。。。。。。。。。。。。。。。\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ’
root: PS1=‘$.。。。。。。。。。。。。。。。。。。。。。。。\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ’
以上便是Ubuntu体系把末端用户名改成白色的技巧了,从终极显现的效因去看,白色的末端用户名借是很夺目的。
相关文章