I changed my command prompt using PS1="[\u@\h \W]\$ "
but after reboot, it returns to be the default command prompt. How can I make this change to be permanent?
Add
PS1="[\u@\h \W]\$ "
to the file .bashrc
(assuming your shell is bash
) in your home directory.
You can do this with:
echo 'PS1="[\u@\h \W]\$ "'>>~/.bashrc
Minor background: PS1
is an environment variable - a variable that's set for your login session. .bashrc
is a file that's read and interpreted by your shell every time it starts up, and you can use it to configure other attributes of the way your shell behaves.
For example, a common way to change your default editor is to add the line
export EDITOR="emacs"
to your .bashrc
.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments