CompileNix's Blog - Colorful Bash

Start Page | RSS Feed | Find Stuff

You like to have a colorful bash but dont want to mess with a complex $PS1?

This might interest you: https://www.kirsle.net/wizards/ps1.html

PS1="$(if [[ ${EUID} == 0 ]]; then echo -n '\[$(tput bold)\]\[$(tput setaf 1)\]\u'; else echo -n '\[$(tput bold)\]\[$(tput setaf 2)\]\u'; fi; echo '\[$(tput setaf 4)\]@\[$(tput setaf 2)\]\H \[$(tput setaf 3)\]\t \[$(tput setaf 4)\]\w # \[$(tput sgr0)\]\[$(tput sgr0)\]')"