内容 |
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=&ls20. 现在每天醒来睁开眼见到的是墙上你那似阳光般的笑靥,好想哪天醒来时,第一眼所触及的是真正的你那似花般甜甜的睡容……quo;$.。。。。。。。。。。。。。。。。。。。。。。。\\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系统把终端用户名改成红色的技巧了,从最终显示的效果来看,红色的终端用户名还是很醒目的。 Ubuntu系统把终端用户名改成红色的技巧五彩秋风送爽挥金如土缤纷17. 其实,人生的道路从来都不平坦,谁都会遭遇各种各样的坎。要像刘翔那样勇往直前,你就能飞跃一道又一道坎,你的人生就充满灿烂和喜悦。13. Let’s work together to make our world a better place.176.不敢高声语,恐惊天上人。《夜宿山寺》 画屏天畔,梦回依约,十洲云水。手捻红笺寄人书,写无限、伤春事。出门搔白首,若负平生志。ubuntu终端颜色,ubuntu终端颜色设置30.Beauty will buy no beef. 漂亮不能当饭吃。 |