Why am I unable to set new command prompt for terminal in OS X Mavericks?

I've tried to do the following:

export PS1="\u \W$ "

It works as expected but after restart the default value of PS1 will be used again. Why? What am I doing wrong? How can I fix it?

And yes, I don't have ~/.bashrc file.


Put it in your ~/.profile file.

  • It works, but why am I unable to manually set it? – FrozenHeart Jul 10 '14 at 9:53
  • 1
    You can set it manually, but it only persists for the current session, so you need to set it at the start of each session in your profile. – Mark Setchell Jul 10 '14 at 9:54
  • I think that export do this – FrozenHeart Jul 10 '14 at 10:00
  • 4
    export makes it available to processes started from the current one, not new ones started from elsewhere. – Mark Setchell Jul 10 '14 at 10:03
  • Did this answer your question? If so, please consider accepting it as the answer. If not, please say what didn't work so that I, and others, can assist you further. Thank you. – Mark Setchell Jul 11 '14 at 12:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .