Customize Mac OSX Terminal prompt

November 7, 2009 § Leave a comment

Mac OSX may contain multiple profiles for Terminal

  • ~/.profile
  • ~/.bash_profile
  • ~/.bashrc

If you are using bash on your terminal, I would suggest not to use .profile and re-direct .bashprofile to .bashrc. Keep .bashrc as your only bash profile to streamline your terminal setup.

To resolve the profile on terminal consider doing this using nano as editor on your OSX Terminal.

To open ~/.bash_profile in nano

$ nano ~/.bash_profile

Enter the following. Save the file by Ctl+o and exit nano by Ctl+x

. ~/.bashrc
ENV=$HOME/.bashrc
export ENV

Save all the settings in .bashrc to avoid duplication

Customize the terminal promot. Enter the following in .bashrc using nano

export PS1=”\u$ ”

This will show username with $ as terminal prompt

Advertisements

Tagged:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Customize Mac OSX Terminal prompt at Web Builders.

meta

%d bloggers like this: