Solution: show only-bash-4.1 in shell command line # Do not show users and paths
Today, I accidentally typed the home Directory deletion command. 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_profile1. Create a. bashrc file in 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 functionssource to take effect: # source ~ /. Bashrc2. bash_profile: Create the. bash_profile file in the current directory: # touch ~ /. Bash_profile # vim ~ /. Bash_profile and enter the following data #. bash_profile # Get the aliases and functionsif [-f ~ /. Bashrc]; then .~ /. Make bashrcfisource take effect below: # source ~ /. Bash_profile: You can see that the current user and path are successfully displayed. ============ Gorgeous split line ============== if you have these two directories, but it still shows-bash-4.1 #. You can refer to the following solution (this solution is taken from the Internet for verification) steps: vim ~ /. Bash_profile (ignore. there are several bash_profile files, and you can create one by yourself.) add export PS1 = '[\ u @ \ h \ W] \ $' at the end and then execute source ~ /. Bash_profile so that the shell can display the path.