Customize Terminal Prompt

In Mac OS X terminal, to customize the terminal prompt, edit the .bash_profile file to include the following line

export PS1=""

Following options are common:

\d - current date - e.g. 11/09/2010
\w - full path to current working directory - e.g. ~/Users/Raj/Documents
\W - current working directory - e.g. Documents
\u - username -e.g. Admin

I use the following for my prompt:

export PS1="[\W$ ]"

You can use any editor to edit the .bash_profile file. This file is located in your home directory (~)

Advertisements

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