Last active
March 19, 2020 19:56
-
-
Save JacksonBailey/26e0b020c2efc2c81c9b1a7836016eef to your computer and use it in GitHub Desktop.
A very simple bash prompt that is red for root and green for other users. If you are using CentOS place in /etc/profile.d to have it apply globally
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# are we an interactive shell? | |
if [ "$PS1" ]; then | |
if [ $(id -u) = 0 ]; then | |
PROMPT_COLOR="$(tput setaf 1)" | |
else | |
PROMPT_COLOR="$(tput setaf 2)" | |
fi | |
PS1="\[${PROMPT_COLOR}\][\u@\h \w]\\$ \[$(tput sgr0)\]" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment