linux occur when switching users: Command Prompt -bash-4.1 $ Error Resolution

Sometimes when users log in using the Linux system you will find the command line prompt becomes: -bash-4.1 $, does not display the user name, path information.

The reason: the user's home directory and environment variables associated files are deleted as a result of

That is, maybe the file: 
.bash_profile .bashrc

These two files are deleted, resulting in this error

Solution: from / etc / skel to copy the missing files back on it

Copy the code
$ 4.1 cp /etc/skel/.bash*--bash ~    

-bash-4.1 $ ## after Zimbabwe Logout copy back, logout user, and then see if the user has been resolved in landing 

[root @ elz-4 ~] # su - erlianzhang 

[erlianzhang. 4-Elz @ ~] $
Copy the code

After landing recovery

If useful to recall attention Ha!

The solution links from: https://www.cnblogs.com/2lianzhang/p/8052312.html

Guess you like

Origin www.cnblogs.com/zxy-come-on/p/11433452.html