Ubuntu系统入门教程-设置彩色控制台提示符(Color Prompt)
纠错,疑问,交流: 请进入讨论区或 请点击进入页面,扫码加入微信群或Q群进行交流
获取最新文章: 扫一扫加入“创客智造”公众号
说明
- 本教程介绍如何在Ubuntu系统下设置彩色控制台提示符(Color Prompt)
- 测试环境:Ubuntu 1604 and Ubuntu 1804
操作步骤
- 通常情况下,在使用Ubuntu的终端时会出现终端打印的内容过多且命令跟输出的内容同样颜色,导致很难找到前一句命令的位置,如下图

-
此时就需要设置彩色控制台提示符(Color Prompt)区别命令跟内容
-
在Ubuntu的
~/.bashrc文件中删除注释force_color_prompt=yes前面的注释符号
$ vim ~/.bashrc
//找到force_color_prompt=yes,且删除前面的注释符号#后保存退出,如下
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes
- 重新打开一个新终端,即可发现设置已生效
![请输入图片描述][2]
参考链接
纠错,疑问,交流: 请进入讨论区或 请点击进入页面,扫码加入微信群或Q群进行交流
获取最新文章: 扫一扫加入“创客智造”公众号


















