Having the time displayed in the bash prompt is useful because you always have a sort of log of duration/time of commands you give. For example, you need to copy a very large directory through the network: you press [Enter], you write your “cp” command that takes, say, one hour. After that, when you look at the screen, you can calculate how long it was running, minus a few seconds it took you to write the “cp” command. Of course you can accomplish the same using the “time” command like this: “time cp something somewhere”. But if you work a lot at the bash prompt (you’re a sysadmin) it’s very convenient in many situations, not only for the above example.
How to do it:
1. become root “su -”
2. edit /etc/bash.bashrc.local
3. add this line
export PS1="\t $PS1"
What this does: it puts the time (\t) in front of your existing prompt. This is the right way to do it too, because even if you upgrade the bash RPM, the bash.bashrc.local file remains untouched.
The prompt will look like this: