Linux CentOS下shell显示-bash-4.1$ 不显示用户名和主机名的解决方法

    xiaoxiao2021-12-14  23

    方法一: 1.在新建用户的~目录下新建或者更改.bash_profile;这个过程中可能需要root用户来新建或者修改 2.在.bash_profile中添加以下内容:export PS1='[\u@\h \W]\$' 3.在新建用户下运行一下命令:source ~/.bash_profile 方法二: 管理员权限下,修改全局配置文件/etc/profile 添加如下代码 --------------------------- #user&hostname export PS1='[\u@\h \W]\$' ----------------------------
    转载请注明原文地址: https://ju.6miu.com/read-963852.html

    最新回复(0)