Prompt Trick: Add the clock to the prompt

In this short article I will show you how to add the clock to your prompt. So, if you are want your prompt to look like this, [08:21:35] user@name:~$, add the following line to your ~/.bashrc .

export PROMPT_COMMAND=”echo -n \[\$(date +%H:%M:%S)\]\ “


Tagged with: , , ,
Posted in The Linux and Unix Articles!

Leave a Reply

Your email address will not be published. Required fields are marked *




Subscribe to get the latest Linux news and how to guides directly on your e-mail!