Customising Mac’s terminal prompt

You can colourise it, if you want.

Open .bash_profile in your editor (I used sublime)


sublime .bash_profile

Add this line


export PS1="\u@\h \w "

Each option means

\d – Current date
\t – Current time
\h – Host name
\# – Command number
\u – User name
\W – Current working directory (ie: Desktop/)
\w – Current working directory, full path (ie: /Users/Admin/Desktop)

Customising Mac’s terminal prompt

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