Is your Mac’s Terminal prompt name long and bloated like this?
Davids-MacBook-Pro:~ techstacker$ cd xxxxLet’s fix it.
Here’s how to change your Terminal prompt name (macOS) quickly:
- Open a new Terminal window and type
cd ~/to go to your Home directory - Type
ls -laand look for a file called.bash_profile. If it’s not there, create one with this command:touch .bash_profile. - Now open your
.bash_profilefile with his command:open -e .bash_profile. - Add this line
export PS1="\u$ "and save it. - 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 xxxxGlorious!