User Tools

Site Tools




The Bash can show all kinds of information in the command prompt. For better readability you can use colours in the prompt to separate the parts.

The following prompt contains user name, machine name and current working directory. It works on either white or black background.

export PS1='\[\e[35;1m\]\u\[\e[0m\]@\[\e[34;1m\]\H: \[\e[0m\]\w> 


How do I add a directory to the path only if it is not yet there?

This article on the superuser forum shows how to write a function that adds a new directory to your path only if it is not yet there.

bash.txt · Last modified: 2015/05/17 17:44 (external edit)