Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've altered the /etc/bashrc file.

I commented out the previous definition and inserted my own:

PS1="--bash: (\u@\h:\w) $"

This is not having any affect. When I make this change at the command prompt, it works great, but then it's not permanent.

share|improve this question

/etc/bashrc is the system setting. The usual place to change the prompt would be the per-user file, ~/.bashrc. You might already have a setting there that's overwriting the system default. Put your prompt string in ~/.bashrc.

Furthermore, there is a quirk in bash's handling of initialization files. The /etc/bashrc and ~/.bashrc files are only read for interactive instances of bash that are not login shell. If you run a login shell, bash only reads /etc/profile, and ~/.bash_profile (or ~/.profile if it doesn't exist). You need to explicitly source your .bashrc from your .bash_profile if the login shell is interactive:

# Work around a well-known bash design bug: bash does not read .bashrc if
# it is invoked as a login shell.
case "$-" in *i*) if test -r ~/.bashrc; then . ~/.bashrc; fi;; esac
share|improve this answer
This can go as a comment in your question, or in this answer. As such, I'm posting in the correct answer that needs more info. If you're looking at customizing your prompt after following Giles Answer, see Gentoo: Prompt Magic – eyoung100 Nov 22 '14 at 1:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.