The CentOS shell command line only shows that the-bash-4.1# does not show the user and path resolution

Source: Internet
Author: User

 today accidentally hit the home directory Delete command, although finally for a variety of reasons did not delete, but the home directory, many files and directories are deleted, and the command line does not display the current user and path.
Reset It below to set two files: ~/.BASHRC and ~/.bash_profile



1. BASHRCcreate a new. bashrc file under the current directory:# Touch ~/.BASHRC# vim ~/.BASHRC
and enter the following data
#. BASHRC
# Source Global Definitionsif [-F/ETC/BASHRC]; Then./ETC/BASHRCfi# User specific aliases and functions
source below makes it effective:# source ~/.BASHRC

2. Bash_profileNew in the current directory. bash_profile File:# Touch ~/. bash_profile # Vim ~/. Bash_profile
and enter the following data#. Bash_profile# Get The aliases and functionsif [-f ~/.BASHRC]; Then. ~/.BASHRCfi
source below makes it effective:# source ~/. Bash_profile
you can see that the current user and path have been successfully displayed.
=========== Gorgeous split-line ============If you have both directories, but still display-bash-4.1#, you can refer to the following scenario (the scenario is excerpted from the web for validation)
The steps are as follows:
Vim ~/.bash_profile(no tube. Bash_profile This file has a few, you can create a new one is also possible)
at the end addexport ps1= ' [\[email protected]\h \w]\$ '
and then executeSource ~/.bash_profile
this way the shell can display the path.

The CentOS shell command line only shows that the-bash-4.1# does not show the user and 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.