Skip to content

bash


.bash_profile and .bashrc

Mac

add lines to the bottom of the .bash_profile file in your home directory

Windows GitBash shell

edit (or create) the .bashrc file in the user's Windows home file (e.g. c:\\Users\\username)


Bash Prompt Colouring

export PS1="\[\e[31m\]\u\[\e[m\]@\[\e[32m\]\w\[\e[m\]$ "

\u is user
\w is working directory

\[\e[31m\] ... \[\e[m\] is red foreground
\[\e[32m\] ... \[\e[m\] is green foreground

\[\e[m\] -> resets colour

\e => escape

30 black
31 red
32 green
33 yellow
34 blue
35 magenta
36 cyan
37 white