ubuntu 命令行提示符 颜色
https://blog.csdn.net/u010953692/article/details/88845430
标题
ubuntu 命令行提示符 颜色
1,系统版本
2,修改 vim .bashrc
1,系统版本
# cat /etc/issue
Ubuntu 18.04.2 LTS \n \l
1
2
2,修改 vim .bashrc
修改 #PS1='KaTeX parse error: Expected '}', got 'EOF' at end of input: …ebian_chroot:+(debian_chroot)}\u@\h:\w$ ’
# pwd
/root
# vim .bashrc
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
#PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;33m\][\t]\[\033[00m\]\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;33m\]\#\[\033[00m\] \[\033[01;34m\]\w\[\033[00m\]\$ '
# source .bashrc
1
\t 24小时格式
# 运行的第几条命令
$ 普通用户和超级用户
33m 黄色
32m 绿色
34m 蓝色
参考: