With this list of special characters, we can change the prompt to see the effect. First, we’ll back up the existing string so we can restore it later. To do this, we will copy the existing string into another shell variable that we create ourselves:
We create a new variable called
ps1_old and assign the value of
PS1 to it. We can verify that the string has been copied by using the
echo $ps1_old[\u@\h \W]\$
We can restore the original prompt at any time during our terminal session by simply reversing the process:
Now that we are ready to proceed, let’s see what happens if we have an empty prompt string:
[me@linuxbox ˜]$ ...