When I start terminal in Ubuntu, I see:
I need to add a timestamp to this, something like:
How can I configure this?
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
Put this at end of your
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)
To apply the ~/.bashrc change type this inside the running terminal:
No need to restart the terminal. This is useful for each change (in the terminal environment)
I find that a great setup is to have 3 colourized groups:
Plus a newline so you are back to the left side!
You can have all this by having the following in your .bashrc file in your home directory.
If you want this plus your timestamps in four colors you can have:
though personally I think I'll now go with:
To do this temporarily but immediately/on-the-fly, for example so that you can have some privacy while making a screencast, you can do the following
The PS1 variable sets the format, source applies that setting by reading from a file.
Now the command line looks like this: