Value of environment variable PS1
| Variable | Description |
|---|---|
| \u | Inserts the username of the current user |
| \h | Inserts the hostname of the system |
| \w | Inserts the current working directory |
| \W | Inserts the base name of the current working directory |
| \n | Inserts a newline |
| \t | Inserts the current time in 24-hour format (HH:MM:SS) |
| \d | Inserts the current date in the format "Weekday Month Day" (e.g., "Mon Sep 20") |
| $ | Inserts a $ symbol for a regular user or # symbol for the root user |
Example
export PS1="\u\$ "
linux