Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I opened my terminal and saw a shell prompt.

 Last login: Fri Feb 15 15:28:16 on ttys000
 john:~ voloda2$ 

How do I change john to alex?

share|improve this question
"john" is either the user or the computer name. Why do you want to change it? – patrix Feb 15 '13 at 13:11
I do not like John. It is a bad guy. – Voloda2 Feb 15 '13 at 13:14
Then it sounds more logical to change your computer- and/or username first. – Gerry Feb 15 '13 at 15:50
up vote 3 down vote accepted

Add the following line to the end of your ~/.bashrc:

export PS1='\u:\W \$ '

Your prompt should now be voloda2:~ $, which is your username, a colon, the current working directory, and a $ if you are a regular user, or a # if you are root. For more prompt customization options, type man bash or visit here for a full list of options.

If you just want to change john to alex, then use export PS1='alex:\W \u \$ '. john is the name of your computer, so if you have appropriate administrator privileges open System Preferences, select Sharing and change the name to whatever you want, and your prompt will automatically update. However, if you are on a network, at work, or using a shared computer, talk to your local system admin before doing this.

share|improve this answer

Your Answer


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.