export PS1="\! \u@\h \D{%Y-%m-%d} \t \w:-)"
Comment:
:-) - a smiley for a happy day!And here is an example how the output looks like:
\w - full working directory, an absolute necessity.
\D{%Y-%m-%d} \t - short iso date and current time including seconds.
\u@\h - who are you, and where... could be quite expensive to get this wrong.
\! - look up the bash documentation for the !<hist number> history expansion feature to conveniently reuse previous commands or command parameters. With \! in the prompt you need the history command less to look up previous commands, but otherwise ommit this information in the prompt if your prompt line has already become too wide.
237 clemens@gavrilov 2011-01-13 19:43:44 ~/dev/src:-)echo 'hi'For original documentation check "man bash" and jump to the PROMPTING section.
hi
238 clemens@gavrilov 2011-01-13 19:43:48 ~/dev/src:-)
No comments:
Post a Comment