Prompt output displays on one line followed by " $" or " #" on the next one. This reduces line wrapping of long command strings.
Example prompt for the current non-privileged user $:
[user@fedora:6.11.6-200.fc40.x86_64:~]
$
[user@fedora:6.11.6-200.fc40.x86_64:~]
$
Change the prompt to root using the current environment:
$ sudo -s
[root@fedora:6.11.6-200.fc40.x86_64:/home/user]
#
[root@fedora:6.11.6-200.fc40.x86_64:/home/user]
#
Add these lines to user’s .bashrc:
Change user prompt to green - NewLine $
export PS1="\e[0;32m[\u@\h:$(uname -r):\w]\e[m\n$ "
Add these lines to root’s .bashrc:
Change root prompt to green - NewLine
export PS1="\e[0;32m[\u@\h:$(uname -r):\w]\e[m\n# "