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