步骤一:
需要进入当前用户的目录:cd ~
root用户为 /root
其他用户为 /home/username
步骤二:
编辑文件 vim .bashrc
添加下面这个参数:
PS1="[\[\e[32;40m\]\u@\h \w \t]$"
#命令解析 前边\[\e[32;40m\] 代表设置为黑底绿字 \u@\h \w \t 举例:root@localhost 当前目录 当前系统时间
需要进入当前用户的目录:cd ~
root用户为 /root
其他用户为 /home/username
编辑文件 vim .bashrc
添加下面这个参数:
PS1="[\[\e[32;40m\]\u@\h \w \t]$"
#命令解析 前边\[\e[32;40m\] 代表设置为黑底绿字 \u@\h \w \t 举例:root@localhost 当前目录 当前系统时间