Skip to content

Instantly share code, notes, and snippets.

@viniciusban
Last active June 1, 2018 03:59
Show Gist options
  • Save viniciusban/25117f6221c6e0b2a70f4cbb6a783968 to your computer and use it in GitHub Desktop.
Save viniciusban/25117f6221c6e0b2a70f4cbb6a783968 to your computer and use it in GitHub Desktop.
Basic .bash_aliases for virtual machines
# PS 1 green when $? is zero. Otherwise, red showing $?.
# Example:
# - [@virtualmachine:~/Documents]$ # <-- green
# - [ 127 @virtualmachine:~/Documents]$ # <-- red
PS1='[${debian_chroot:+($debian_chroot)}$(RC=$?;GREEN="\[\033[0;32m\]";RED="\[\033[0;31m\]";[ $RC -eq 0 ] && echo ${GREEN} || echo "${RED} ${RC} ")@\h\[\033[00m\]:\[\033[00;90m\]\w\[\033[00m\]]\$ '
set -o vi
unalias ls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment