Centos shell command line only show-bash-4.1 # do not show the user and path solution,
Zookeeper accidentally called the home Directory deletion command today. Although it was not deleted for various reasons, many files and directories in the home directory were deleted, the command line does not display the current user and path.
Next, you need to set two files for resetting :~ /. Bashrc and ~ /. Bash_profile
1. Create a. bashrc file in the current directory: # touch ~ /. Bashrc # vim ~ /. Bashrc
Enter the following data
#. Bashrc
# Source global definitionsif [-f/etc/bashrc]; then./etc/bashrcfi # User specific aliases and functions
# Source ~ /. Bashrc
2. Create a. bash_profile file in the current directory: # touch ~ /. Bash_profile # vim ~ /. Bash_profile
Enter the following data #. bash_profile # Get the aliases and functionsif [-f ~ /. Bashrc]; then .~ /. Bashrcfi
# Source ~ /. Bash_profile
You can see that the current user and path are successfully displayed.
============ Gorgeous split line ============== if you have these two directories, -bash-4.1 # is displayed. You can refer to the following solution (this solution is taken from the Internet for verification)
The procedure is as follows:
Vim ~ /. Bash_profile (do not worry about the number of. bash_profile files. You can create one by yourself)
Add export PS1 = '[\ u @ \ h \ W] \ $' at the end'
Then execute source ~ /. Bash_profile
In this way, the shell can display the path.