Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On a Mac the hostname and prompt is:

workstation:~ thomas$

On Ubuntu Linux it would be:

thomas@workstation:~$ 

How can I make the OS X prompt look like the Ubuntu one?

share|improve this question
    
The word you were looking for is "prompt", and you'll probably find a lot more information now, when doing a search for it ;) –  slhck Jun 29 '12 at 7:45

1 Answer 1

up vote 4 down vote accepted

Just run this command in terminal

PS1="[\u@\h:\w]$ "

here

  • u represents username
  • h represents hostname
  • w represents current working directory

This is temporary, that means after running this command if you close the terminal again, the default prompt will appear.

If you want to set permanently, then insert below line in your .bash_profile file under your home directory:

export PS1="[\u@\h:\w]$ "
share|improve this answer
    
You forgot the colon :, and the syntax in OS X is the same, since it also uses bash. –  slhck Jun 29 '12 at 7:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.