Add .bash_profile to your Mac Terminal

Do you want your Terminal to be colored?

Do you want to have a nice welcoming message when you open up the console?

1. Create /.bash_profile

Run the following command to create your own .bash_profile file.


sudo echo > ~/.bash_profile

2. Edit and Save the file

Edit the file:


sudo nano ~/.bash_profile

Paste the following code:


echo "What's up, Rick?"

export PS1='\[$(tput setaf 3)\]\u@\h:\[$(tput sgr0)$(tput setaf 5)\]\w\[$(tput sgr0)$(tput setaf 2)\] \[$(tput sgr0)\]$ '

Save and restart your terminal. Enjoy! 😉

About Rick

Senior Front-end Software Engineer from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*