PS1 is an environment variable that defines the makeup and style of the command prompt.
What happens when this is stored in ~/.bash_profile?
export PS1=">> "
export PS1=">> "sets the command prompt variable and exports the variable. Here we change the default command prompt from
- After using the
sourcecommand, the command line displays the new command prompt.
Let’s try it out!
Open ~/.bash_profile in nano.
On a new line, beneath the last entry, set the
PS1 variable equal to
">> " (make sure there is one space following
Save the file and exit nano, and press Enter into a new line in the terminal.
source to make the changes in
~/.bash_profile available. The command prompt should now look like
Let’s try out the new command prompt. In the terminal, type:
In the past two commands, did you notice that the command prompt has changed and is no longer