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