wiki/运维/操作系统/Linux/常用运维命令/2.Linux命令行颜色突出显示.md
2025-01-02 10:46:09 +08:00

16 lines
503 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Linux命令行颜色突出显示小技巧
为了区分生产环境和测试环境强烈调整Linux的命令行颜色避免误操作导致生产故障很不起眼的一个操作但是在犯蒙时刻能救命~
```
[root@centos ~]#vim /etc/profile
#在最后面一行追加下面代码
PS1="\[\e[1;41;33m\][\u@\h \W]\\$\[\e[0m\]"
#执行命令使其生效
source /etc/profile
```
![效果图](C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\image-20230525042640554.png)