linux 修改用户名 终端,如何修改Ubuntu终端用户名颜色修改为红色
Linux操作系統:Ubuntu 14.04
由于輸入特定符號會導致亂碼,亂碼部分用.............顯示,有些截圖顯示!!!!!!!!
整個操作代碼流程圖片和最終顯示結果
輸入>echo $PS1
顯示:如上圖
在個人用戶文件夾輸入
輸入gedit ~/.bashrc
修改這幾行代碼
if [ "$color_prompt" = yes ]; then
PS1=....
else
PS1==...
fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
重改為:
# if [ "$color_prompt" = yes ]; then
#PS1='$..........\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
# else
# PS1='$........................\u@\h:\w\$ '
# fi
unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
然后再文件的末尾一行加上:
(下一行是截圖)PS1='$...................\033[01;31m\]\u\[\033[00m\]@\h:\w\$ '
保存后退出,然后source一下,也就是輸入>source ~/.bashrc
在root文件夾里面位置 /root也同樣操作一遍。
以上是我個人的修改。
以下是網上的參考:(再下面是截圖)
customer:? ? ? ? PS1='$........................\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
root:? ? ? ? ? ? ? ? PS1='$........................\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
總結
以上是生活随笔為你收集整理的linux 修改用户名 终端,如何修改Ubuntu终端用户名颜色修改为红色的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux系统远程工具,分享|Remmi
- 下一篇: linux 全新编译安装,全新linux