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?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
Add the following line to the end of your
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
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.