Customize your promt and make it dynamical

This lines of code show be in your .bash_profile. You can change the color or/and the info that appears in your prompt.

export MAX_PATH_LENGTH=25
export PROMPT_COMMAND='PS1="\[\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u.\h: \`if [[ `pwd|wc -c|tr -d " "` > $MAX_PATH_LENGTH ]]; then echo "\\W"; else echo "\\w"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"'


Posted

in

by

Tags:

Comments

Leave a Reply