Reputation: 619
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?
Upvotes: 2
Views: 761
Reputation: 1334
Add this line PS1="[\u@\h \W]\$ " to the .bashrc file in your home directory.
If the bashrc is not open.
Then set export EDITOR="vim".
Upvotes: 1
Reputation: 8492
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
.
Upvotes: 1
Reputation: 190
Add this line PS1="[\u@\h \W]\$ "
to the .bashrc file in your home directory.
Upvotes: 3