In Linux, modify the environment variable PS1 (command line prompt), you can use VI to edit the/etc/profile file, and add the following at the end:
Export PS1 = '[/u @/h/W]/$'
You can, where/u shows the current user account,/h shows the current host name,/W shows the current path,/$ shows the '$' symbol
/W can replace/W to convert absolute paths to relative paths.
The following describes the meaning of the default special symbols in the environment:
/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, the name is FC4, and the name of. Linux is omitted.
/T: The display time is in the 24-hour format, for example, HH: mm: Ss.
/T: The display time is 12 hours.
/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. In the home directory ~ Replace
/W: Use basename to get the working directory name. Therefore, only the last directory is listed.
/#: Commands issued
/$: The prompt character. If it is root, the prompt is: #, and the normal user is: $