How to Change Your Terminal Prompt Name on macOS

Is your Mac’s Terminal prompt name long and bloated like this?

Davids-MacBook-Pro:~ techstacker$ cd xxxx

Let’s fix it.

Here’s how to change your Terminal prompt name (macOS) quickly:

  1. Open a new Terminal window and type cd ~/ to go to your Home directory
  2. Type ls -la and look for a file called .bash_profile. If it’s not there, create one with this command: touch .bash_profile.
  3. Now open your .bash_profile file with his command: open -e .bash_profile.
  4. Add this line export PS1="\u$ " and save it.
  5. Quit and restart your Terminal.

The \u flag sets the prompt to your Mac’s User Account name.

This is how mine looks now:

techstacker$ cd xxxx


Has this been helpful to you?

You can support my work by sharing this article with others, or perhaps buy me a cup of coffee 😊


Share & Discuss on