Subal Charla
Subal Charla

Reputation: 159

Change in the hostname/user in Terminal in Leopard OSX

My terminal previously showed subalcharla$ at the command line.

The terminial is now showing subalcharla@subal-charlas-macbook ~ $.

How do I go back to the original setting?

What is the difference between the two?

How did this get changed without my doing so?

Upvotes: 2

Views: 854

Answers (2)

Jonathan Baldwin
Jonathan Baldwin

Reputation: 877

At the end of ~/.profile add the line

export PS1='\u$ '

to get your old prompt back.

To do this you can type

 nano ~/.profile

which will bring up a text editor. Press down until you get to the bottom of the file. Hit Enter to create a new line, and paste in

export PS1='\u$ '

Press Control+X to exit the editor and say "yes" when asked if you want to save. Now restart your terminal and your prompt should be restored.

The first prompt you gave shows your username, the second shows your username and hostname. There is no error and the functionality of your bash shell is not changed by changing the prompt.

Something must have changed your PS1 environment variable, maybe a system update or the installation of software. It's probably benign though.

Upvotes: 2

Phillip Mills
Phillip Mills

Reputation: 31016

I don't know how it got changed, but it's controlled by some symbol definitions. Use "man bash" in the terminal and search for the section called "PROMPTING". There are symbols named PS1-to-4 that it uses to construct the prompt.

Upvotes: 0

Related Questions