CentOS under the shell display-bash-4.1# does not display the user name path resolution

Source: Internet
Author: User

CentOS under the shell display-bash-4.1$ does not display the user name path resolution

Problem Description:

A new user is added under CentOS, and the shell script information is as follows when logged in:

650) this.width=650; "src=" Http://up.2cto.com/2013/0605/20130605091807247.jpeg "style=" border-width:0px;padding:0 px;margin:0px;list-style:none;width:118px;height:46px; "alt=" 20130605091807247.jpeg "/>

Rather than the combination of [email protected] we often see, it looks uncomfortable.


The reason is that when you create a user, if you specify the-m parameter, and therefore do not create a user home directory, so the system will not be in the creation of users, automatically copy the user environment variable files in the/etc/skel directory to the user home directory, it will cause these files do not exist, appear-bash-4.1# Problem, just copy it manually.


workaround One, not validated


[Email protected] 3307]# ls-a/etc/skel/
.  .. . bash_logout. Bash_profile. BASHRC


Direct Cp-a/etc/skel/* to the home directory.

workaround Two, verified that this method is valid

-bash-4.1#

Above this is the state of the previous settlement

Here's how:


1. In Terminal input:

[Plain]

VI ~/.bash_profile

2. If no. Bash_profile can be added by itself. Then add the following to the file:

[Plain]

Export ps1= ' [\[email protected]\h \w]\$ '

Note ' is the character in the English state.

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

[Plain]

SOURCE ~/.bash_profile

In this way, the shell will initially display the familiar [email protected] format, as shown below:

[[Email Protected]_back ~]#

This article is from the "Lanzhou Linux operation and Maintenance" blog, please be sure to keep this source http://linuxzkq.blog.51cto.com/9379412/1662520

CentOS under the shell display-bash-4.1# does not display the user name path resolution

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.