linux修改用户登陆后shell字体的颜色

linux 修改用户登陆shell字体颜色———

自定义

linux启动后环境变量加载的顺序为:etc/profile → /etc/profile.d/*.sh → ~/.bash_profile → ~/.bashrc → [/etc/bashrc]

直接编辑/etc/bashrc文件
在文件末尾插入下面的语句:

PS1="\[\e[37;40m\][\[\e[32;40m\]\u\[\e[31;40m\]@\h\[\e[36;40m\]\W\[\e[31;40m\]\]\\$ "

linux修改用户登陆后shell字体的颜色_第1张图片

每一个 ‘[\ ’ 对应一个 ‘]’

32是字体颜色,40m是行背景颜色,下面是一些颜色对应的数字

linux修改用户登陆后shell字体的颜色_第2张图片

你设置的最后字体颜色就是你输入字体的颜色

linux修改用户登陆后shell字体的颜色_第3张图片

用上面的PS1就是这样的结果,我觉得还行吧。

嘿嘿。

你可能感兴趣的:(linux)