0 Members and 2 Guests are viewing this topic.
if [ -f $HOME/.dir_colors ]; then /usr/bin/dircolors -b $HOME/.dir_colorselif [ -f /etc/DIR_COLORS ]; then /usr/bin/dircolors -b /etc/DIR_COLORSelse /usr/bin/dircolors -bfi
if [ -f $HOME/.dir_colors ]; then eval $(/usr/bin/dircolors -b $HOME/.dir_colors)elif [ -f /etc/DIR_COLORS ]; then eval $(/usr/bin/dircolors -b /etc/DIR_COLORS)else eval $(/usr/bin/dircolors -b)fi
Misko, that is a great idea. Having root as either bold or a different color just makes sense.
I like that idea too, Misko.
I'm surprised people have not been doing this within their profiles. I've had my terminal colors and PS1 set for years across distros.Here is my prompt configuration (compilation of various online resources over time):
Great idea, Misko, especially considering newcomers to Linux would be a bit overwhelmed in having to figure that out.I have configured it myself. BUT I definitely would prefer it coming out of the box this way.In addition to this and even more important for me would be to implement that broken links are shown in a different color like this:The last couple of days I have extensively worked with softlinks and it was a huge hassle with the default setting not showing valid and broken links in different colors.Thanks, riser, for sharing!
leafpad $HOME/.bashrc
if [ $USER = 'root' ]; then PS1="\[\033[01;31m\]$USER@$HOSTNAME\[\033[0;00m\] \[\033[01;32m\]\w\\$\[\033[0;00m\] "else PS1="\[\033[01;33m\]$USER@$HOSTNAME\[\033[0;00m\] \[\033[01;32m\]\w\\$\[\033[0;00m\] "fi
if [ $USER = 'root' ]; then #If user is root just print the hostname in yellow PS1="\[\033[01;33m\]$HOSTNAME\[\033[0;00m\] \[\033[01;32m\]\w\\$\[\033[0;00m\] "else PS1="\[\033[01;97m\]$USER@$HOSTNAME\[\033[0;00m\] \[\033[01;32m\]\w\\$\[\033[0;00m\] "fi