This is an old revision of the document!
Documentation by Joran Martijn (11 May 2021)
By default the terminal is a very monotone and hard to navigate. The prompt is indistinguishable from the commands and the output, and the 'ls' output looks the same whether they are files or directories. We can configure our terminal experience by modifying the so-called .bashrc file.
The .bashrc file is loaded whenever you open a new terminal session, either by simply opening the Terminal program or by SSHing into a remote server.
Adjusting the look of the prompt
The look and behaviour of the prompt is controlled by the so called $PS1 environment variable. It can be quite tricky to set this up from scratch, though you are free to try of course. There is many guides out there on the internet. I found that the set up of an old colleague of mine, Jimmy Saw, worked very well.
Add the following line to your .bashrc
# Jimmy Saw's prompt (only show current directory) export PS1="\[\e[00;37m\][\[\e[0m\]\[\e[00;31m\]\h\[\e[0m\]\[\e[00;37m\]][\[\e[0m\]\[\e[00;32m\]\u\[\e[0m\]\[\e[00;37m\]][\[\e[0m\]\[\e[00;33m\]\W\[\e[0m\]\[\e[00;37m\]] \[\e[0m\]"
Reload your .bashrc with source ~/.bashrc. You're prompt should now be colored and more pleasant to look at. It will show you the Hostname in red, your Username in green, and the current directory you are in in yellow.
Alternatively, if you wish to see the absolute directory path of your current location, you can use this prompt instead:
# Jimmy Saw's prompt (show entire directory path) export PS1="\[\e[00;37m\][\[\e[0m\]\[\e[00;31m\]\h\[\e[0m\]\[\e[00;37m\]][\[\e[0m\]\[\e[00;32m\]\u\[\e[0m\]\[\e[00;37m\]][\[\e[0m\]\[\e[00;33m\]\w\[\e[0m\]\[\e[00;37m\]] \[\e[0m\]"
