In OS X the default command line prompt in Terminal is “ComputerName:Current Directory User$”. You can modify this by adding/amending a small hidden configuration file called .profile in the user’s home directory.
1. Start Terminal
2. Type:- nano .profile and hit Enter
![](files/term1.jpg)
3. Type:- export PS1=” “ with whatever you wish to have as your prompt between the “ ” marks
![](files/term2.jpg)
4. Hit: Ctrl + o then Enter to save the .profile file
(that’s hold the Ctrl key at bottom left of the keyboard & tap the “o” key then press the Enter or Return key)
5. Hit: Ctrl + x to exit the nano editor and return to the command line prompt
6. Type:- exit and hit Enter to quit the Terminal program, or hit the Cmd key + q, or choose Quit Terminal from the Terminal Menu Bar Listing.
7. Restart Terminal which will now be showing your new command line prompt!
![](files/term3.jpg)
There are many variables that can be used to construct a prompt to suit your needs:-
• \d - Current date
• \t - Current time
• \T - Current Time in different format
• \h - Host name
• \# - Command number
• \u - User name
• \W - Current working directory name
• \w - Full Path to current working directory
• \s - Shell name
• \v - Shell version #
A nice example scripts would be export PS1=”\u@\h[\w]\$ “
Changing the Terminal Title Bar
For a nice additional touch you can also change Terminal’s title bar by adding the line
echo -n -e "\033]0;Your Title Here\007" to the .profile configuration file at stage 3 above, the same variables can be used if required.
Here’s my .profile configuration file.
![](files/termtitle1.jpg)