先取得root权限,然后在终端如下操作
[root@host]$su -
然后输入密码
接着
[root@host]#PS1='[\u@\H \W]\$'
你取得root权限后在,在终端命令下输入这个,一定要区分大小写,才能保证完整的显示你原来的格式。
你只是修改了PS1的系统变量而已。
一定要区分大小写
1、vi ~/.bash_profile
2、PS1='[\u@\H \W]\$' 保存
3、source ~/.bash_profile
编写更好Bash脚本的8个建议:http://www.linuxdiyf.com/linux/14970.html
Linux下获取电脑硬件配置信息的bash脚本代码:http://www.linuxdiyf.com/linux/3794.html
Bash中的特殊字符大全:http://www.linuxdiyf.com/linux/12618.html
提高Linux工作效率的十大bash技巧:http://www.linuxdiyf.com/linux/9096.html
Bash下如何逐行读取一个文件:http://www.linuxdiyf.com/linux/13634.html