-Bash-4.1 # solution when this occurs,
-Bash-4.1 # adjust-bash-4.1 # echo $ PS1 export PS1 = "[\ u @ \ h \ W] \ $"-bash-4.1 # echo $ PS1 \ s-\ v \ $-bash-4.1 # if [$ UID-gt 199] & ["'id-gn '" = "'id-un' "]; then umask 002 else umask 022fi for I in/etc/profile. d /*. sh; do if [-r "$ I"]; then if ["$ {-# * I }"! = "$-"]; Then. "$ I" else. "$ I">/dev/null 2> & 1 fi fidone unset iunset-f pathmungeexport PS1 = "[\ u @ \ h \ W] \ $" NOTE: Add export TERM = xterm Note: to add it to the system, set ["$ PS1" = "\ s-\ v \ $"] in/etc/bashrc. & amp; PS1 = "[\ u @ \ h \ W] \ $" the values of PS1 in the file are as follows: \ d: represents the date, in the format of weekday month date, for example, "Mon Aug 1" \ H: complete host name. For example, if my machine name is fc4.linux, this name is fc4.linux \ h: only the first name of the host. In the preceding example, It is fc4 ,. linux is omitted \ t: The display time is in the 24-hour format, for example, HH: MM: SS \ T: The display time is in the 12-hour format \ A: The display time is in the 24-hour format: HH: MM \ u: Account name of the current user \ v: BASH version \ w: complete working directory name. In the home directory ~ Replace \ W: Use basename to get the name of the working directory. Therefore, only the last directory \ # is listed. For example, if it is root, the prompt is: #, for common users: $