Linux CentOS Shell display-bash-4.1$ does not display user name path

Source: Internet
Author: User
Tags centos

Linux CentOS Shell display-bash-4.1$ does not display the user name path solution

Problem Description:

CentOS A new user, log in after the information of the shell script is as follows:

Rather than the combination of username@hostname we often see, it looks uncomfortable.

Solution:

The reason for the problem is that there is no configuration. Bash_profile problem, you can configure this file to solve the problem.

1. In Terminal input:

[Plain]

VI ~/.bash_profile

2. If not, bash_profile can add it yourself. Then add the following to the file:

[Plain]

Export ps1= ' [U@h w]$ '

Note ' is the character of the English state.

3. Enter the following instructions for the change to take effect:

[Plain]

SOURCE ~/.bash_profile

In this way, the shell will begin to display the familiar username@hostname format, as shown in the following figure:

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.