Linux host name color settings, ps1 settings, but linux has a color RedHat font and background color change method: Command: PS1 = "[\ e [32; 1 m \ u @ \ h \ W] \ $ "or export PS1 =" [\ e [32; 1 m \ u @ \ h \ W] \ $ "for the differences between the two, please refer to the Environment Variable related information explanation: \ e [32; 1 m: this is the escape character that controls the font and background color, 30 ~ 37 is the font color, 40 ~ 47 is the 32 in the background color example. The position of the 1 m digit can be reversed, for example, \ e [1; 32 m. If it is in the X environment, you can change the range of 1 to 0 ~ 10, some useless places: 0 or do not write (\ e [0; 32 m or \ e [; 32 m) Show light color, 1: Show highlighted 4: underline ..... if the effect is not good but cannot be restored, do not write the number before m, such as \ e [32; m, or log out directly and log on to \ u \ h \ W: this is an escape character. \ d: represents a 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 normal users, the value $ \ n indicates that the font of a new row is not limited to one color. It can have multiple colors: PS1 = "[\ e [32; 1 Mbit/s \ u @ \ e [35; 1 Mbit/s \ h \ e [31; 1 Mbit/s \ W] \ $ "the above two Commands will become invalid after logging out, use the following method to make it permanently effective: vi/etc/profile is in the "export PATH ..... "add a line below: export PS1 =" [\ e [32; 1m \ u @ \ h \ W] \ $ "log out and log on again. If the line does not take effect, use the source/etc/profile command or restart the machine.