Edit
~ . Bashrc file under the Directory
Add PS1 = '\ [E \ [31m \] [@ \ W] \ $'
You can.
Where \ [E \ [31m \]
Set the command prompt to red -- 31
The specific format is PS1 = '\ [E \ [Front; back M \] [\ parameter] \ $'
You can change the value to different colors.
Background Color
30 40 black
31 41 red
32 42 green
33 43 yellow
34 44 blue
35 45 purple red
36 46 blue
37 47 white
In addition
\ D: # represents the date, in the format of weekday month date, for example: "Mon Aug 1"
\ H: # complete host name
\ H: # Only the first name of the host
\ 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 information
\ W: # complete working directory name
\ W: # Use basename to get the working directory name. Therefore, only the last directory is listed.
##: # Commands
\ $: # Prompt character. If it is root, the prompt is: #, and the normal user is: $