Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I put this is .bashrc

# colors
NC="$(tput sgr0)"
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
# etc ...

PS1="\[$BROWN\]\u \[$CYAN\]#\# \[$PINK_BLD\]!\!\[$NC\] \[$BLUE\]\W: \[$NC\]"


deepo #50 !545 ~: echo "This is an example what it will look like."

What is, and how do I use, the hash 50 indication?

There are many pages on how to do the PS1 (e.g., http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html) but from fast searches of those I get only standard descriptions of the hash thing (in this case, "the command number of this command").

share|improve this question
I'm not sure what else you're looking for. It's the current command number. You'll see it increasing by one each time you type a new command. –  Mat May 6 '12 at 17:20
@Mat I think he wants to know why it is useful. For the history number \! is see good use, but for the command number? –  Bernhard May 6 '12 at 17:51
AFAICT from a quick perusal through the bash manual, the command number is only used by the fc built-in. –  jw013 May 7 '12 at 1:51
Yes, I assumed it could be used somehow. I never use fc, but who knows? Good to know. –  Emanuel Berg May 7 '12 at 17:43

Your Answer


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

Browse other questions tagged or ask your own question.