Mac OS X Terminal Profile

I have been wondering how to change the Mac OS X Terminal profile, I was sick and tired of seeing of seeing the hostname followed by the user name along with a space and the current directory. I decided it was time to look for the Mac OS X Terminal profile, I was only armed with what I knew from Linux, I knew a simple find command would start my search so I went with:

sudo find / -iname profile

This yielded me a few results, one that really looked familiar was /private/etc/profile so I decided to look inside the file. The important part of this file is the last if statement this leads us to /etc/bashrc which holds all the information we are looking for.

Inside /etc/bashrc there is a line that says “PS1=”, this is a great because I knew if I opened Terminal and typed:

echo $PS1

The results would be the same as PS1= inside /etc/bashrc, so I changed it to my Linux counter part to look something more like:

\u@\h:\W\$

What this is saying is disply the username@host:WorkingDirectory$User-If user is root use #.

Tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.