Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I've got a new Mac and I've noticed on the terminal I get a null instead of some kind of name there before on my previous computer.

Last login: Fri Mar  9 10:14:57 on ttys000
(null):~ Macuser$

I'm pretty sure thats not normal and occasionally it does fix itself! Why is it doing this?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I had the same problem too. Fixed it by following this trick

share|improve this answer
4  
For preference it is better to summarise the answer and then provide an additional link. It may sound pedantic, but technically you haven't provided an answer, just a link to an answer. It might not seem important, but for readability of the question and answer together (particularly important where an answer is accepted) it is much better if they can be appreciated without requiring a user to leave the site - plus it shows that you have an understanding of the answer if it is in your own words. Thanks - Dan –  stuffe Mar 9 '12 at 19:58
    
In addition to @stuffe’s comment, it would help if the OP would say how that helped them solve the problem and what the cause of the problem was. That link points to a very generic “how to customize the prompt” article. The mystery here is why it’s displaying “null” when it would normally display the current host name automatically by default. –  Chris Page Mar 10 '12 at 20:48

Have a look in your .bashrc and .bash_profile... for instance I have the line

PS1="\[\e[0;32m\]\u@monkey:\w\$ \[\e[0m\]"

before fi to set my prompt.

share|improve this answer
    
Hard-coding the host name is usually undesirable, because you want it to reflect the current host name, which may change depending on the network it’s connected to, or if it is explicitly renamed. That’s why bash supports \h in PS1 to display the current host name. –  Chris Page Mar 10 '12 at 20:45

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.