How (and where) can one change 'user@host $:' pattern in gnome-terminal?

When I start terminal in Ubuntu, I see:

ilya@HOST:~$

I need to add a timestamp to this, something like:

2011-10-09T09:32:00 ilya@HOST:~$

How can I configure this?


Solution 1:

Put this at end of your ~/.bashrc

PS1="\D{%F}T\t $PS1"

Then restart your terminal. For explanations, read manual page of bash, search for ^PROMPTING

(sorry, the first version of this answer reported erroneously single quotes instead of double)

Solution 2:

There is a good article about how to change your bash prompt and what all the special symbols (like \h) mean. It also has a link about how to change the colors in you prompt.

As far as applying the changes in your .bashrc, just run source ~/.bashrc

Solution 3:

To apply the ~/.bashrc change type this inside the running terminal:

exec bash

No need to restart the terminal. This is useful for each change (in the terminal environment)