Skip to content

Instantly share code, notes, and snippets.

@stojg
Last active December 15, 2015 16:29
Show Gist options
  • Save stojg/5289387 to your computer and use it in GitHub Desktop.
Save stojg/5289387 to your computer and use it in GitHub Desktop.
My favorite bash prompt
PS1="\[\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u@\h: \`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\w"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment