Get a Colour Command Prompt in your Terminal Windows
Whenever you open a terminal window a script file called .bashrc is run. This establishes certain settings within your terminal environment.
In your home folder, if you type:
You will see the contents of this file listed to the screen.
To stop the output whizzing past in a flash type the following:
cat .bashrc | less
This will allow the less program to handle the output. You can then scroll backwards and forwards through the contents of the file using the Home, End and Up Arrow and Down Arrow keys. Q will exit back to the prompt. This is a convenient way to examine text files safely – there is no danger of you accidently making changes to them.
Within the .bashrc file are some lines that look like this:
# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
if you want to have a colour prompt in your terminal windows, in your home folder type:
This causes the gedit editor top open the file so you can make changes to it. Be Careful! Change the line that said:
to now say:
Save the file, and close gedit. Close the terminal window and open a new terminal window. I use keyboard shortcuts a lot, so I do this through:
You should now see a colour prompt.
It’s not life-changing perhaps, but it helps to visually distinguish the output from the shell prompt.