MacOS – How to restore the computer’s username in Terminal

macosterminal

I would like to restore the previous name (default) in my terminal. How can I do that?

I changed to $ sign only by applying this code:

echo "export PS1='$ '" >> ~/.bash_profile
. ~/.bash_profile

but couldn't manage to restore it.

Best Answer

Simply enter

nano ~/.bash_profile

then go to the line

export PS1='$ '

and delete that line. Then save the file and exit nano. After then execute

. ~/.bash_profile

That will be load the settings from this file.