Linux CentOS under the shell display-bash-4.1$ does not display the user name and host name of the workaround

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.