Can't change my user bash prompt color, while root prompt does work correctly and changes colors whenever I edit /root/.bashrcMy root and user .bashrc are identical except for the colors:# Check for an interactive session
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[1;33m\][\u @ \@ \w]\$ \[\e[0;32m\]'
#setup
Can't change my user bash prompt color, while root prompt does work correctly and changes colors whenever I edit /root/.bashrcMy root and user .bashrc are identical except for the colors:# Check for an interactive session
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[1;33m\][\u @ \@ \w]\$ \[\e[0;32m\]'
#setup
Can't change my user bash prompt color, while root prompt does work correctly and changes colors whenever I edit /root/.bashrcMy root and user .bashrc are identical except for the colors:# Check for an interactive session
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[1;33m\][\u @ \@ \w]\$ \[\e[0;32m\]'
#setup
I added this command to my root .bashrc file to add color to my prompt
and to simplify its path portion to the lowest level directory,
Code:
export PS1="\e[1;31m\u@\h:\W\$\e[m "
and my bash prompt comes up ending with $ when I expected #.
Also, occasionally, when I enter a command, part of that command
becomes part of my prompt!
If the following is a prompt and command,
Code:
#
# /etc/bash.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Create the prompt: Green for a normal user, RED for ROOT
NORMAL="\[\e[0m\]"
RED="\[\e[1;31m\]"
GREEN="\[\e[1;32m\]"
PS1="$GREEN\u[$NORMAL\w$GREEN]# $NORMAL"
if [[ $EUID == 0 ]] ; then
PS1="$RED\u[$NORMAL\w$RED]# $NORMAL"
else
We used to type man to find out forgotten parameter of special command.However,there’s only single color in the long output of man command and we need to take a hard look at on it.Here we can try to get colors in man page by edit .bashrc file.
Open .bashrc with your favourite editor:
gedit ~/.bashrc
add following into the end:
Possible Duplicate:
Is it possible to configure Bash so that STDERR can be a different color than STDOUT?
In bash, the only color I know how to modify is the prompt, using \[ and \].
I found the problem.These lines of code in my ".xinit" file that allow me to enter Japanese text were the problem:# Setup SCIM for Japanese input
export XMODIFIERS=@im=SCIM
export GTK_IM_MODULE="scim"
export QT_IM_MODULE="scim"
scim -f x11 -c simple -dI'll comment them out for now. Lately I reconfigure Openbox much more often than I type Japanese.
On one of my Ubuntu 11.10 servers, when I use sudo -i to become the root user, root's .bashrc is not being executed.