2

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\]"

So

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").

  • 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
  • 1
    @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
  • 1
    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
0
\#

stands for the current command number.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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