turtlebot3-burger_150.png
turtlebot3-waffle-pi_150.png
turtlebot3-arm_150.png
walking-y2_150.png
turbot3-multi_150.png
turbot3-dl-ros1_150.png
turbot3-ai.png
turbot3-dl-ros2_150.png
turbot3-slam_150.png
turbot3-arm_150.png
turtlebot4-lite_150.png
turtlebot4-pro_150.png
turbot4-dl_150.png
turbot4-ai_150.png
aidriving-racebot_150.png
aidriving-autodrive_150.png
turtlebot-arm_150.png
openmanipulator-x_150.png
Home » Ubuntu系统入门教程 » Ubuntu系统入门教程-设置彩色控制台提示符(Color Prompt)

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群进行交流

获取最新文章: 扫一扫加入“创客智造”公众号


标签: ubuntu系统入门教程