New CentOS Add a user, log in to find that the shell script information does not display the user name and host name, but instead shows the-bash-4.1$, instead of the [email protected]$ combination that we often see, looks particularly uncomfortable. The cause of the problem is because there is no configuration. Bash_profile problem, or no problem with this file, you can configure or create a new file to solve the problem. Solution: 1. Create new or change. Bash_profile in the new user's ~ directory; This process may require the root user to create or modify 2. Add the following in. Bash_profile: Export ps1= ' [\[email Protected]\h \w]\$ ' 3. Run the command under new User: source ~/.bash_profile so that the user name and hostname are displayed properly
Linux CentOS under the shell display-bash-4.1$ does not display the user name and host name of the workaround