Skip to main content
even better code
Source Link
psygo
  • 243
  • 2
  • 21

You could build upon @goldilocks and @Michael Durrant's answers to create something more readable like this:

CYAN="\[\e[01;36m\]" WHITE="\[\e[01;37m\]" BLUE="\[\e[01;34m\]" TEXT_RESET="\[\e[00m\]" TIME="\t" CURRENT_PATH="\W" ROOT_OR_NOT="\$"  export PS1="${CYAN}[${REDBLUE}\t$${TIME}${WHITE} \W$${CURRENT_PATH}${CYAN}]\$$]${ROOT_OR_NOT}${TEXT_RESET} " 

Which will result in:

preview

You could build upon @goldilocks and @Michael Durrant's answers to create something more readable like this:

CYAN="\[\e[01;36m\]" WHITE="\[\e[01;37m\]" BLUE="\[\e[01;34m\]" TEXT_RESET="\[\e[00m\]" export PS1="${CYAN}[${RED}\t${WHITE} \W${CYAN}]\$${TEXT_RESET} " 

Which will result in:

preview

You could build upon @goldilocks and @Michael Durrant's answers to create something more readable like this:

CYAN="\[\e[01;36m\]" WHITE="\[\e[01;37m\]" BLUE="\[\e[01;34m\]" TEXT_RESET="\[\e[00m\]" TIME="\t" CURRENT_PATH="\W" ROOT_OR_NOT="\$"  export PS1="${CYAN}[${BLUE}${TIME}${WHITE} ${CURRENT_PATH}${CYAN}]${ROOT_OR_NOT}${TEXT_RESET} " 

Which will result in:

preview

Source Link
psygo
  • 243
  • 2
  • 21

You could build upon @goldilocks and @Michael Durrant's answers to create something more readable like this:

CYAN="\[\e[01;36m\]" WHITE="\[\e[01;37m\]" BLUE="\[\e[01;34m\]" TEXT_RESET="\[\e[00m\]" export PS1="${CYAN}[${RED}\t${WHITE} \W${CYAN}]\$${TEXT_RESET} " 

Which will result in:

preview