LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   time as shell prompt (https://www.linuxquestions.org/questions/linux-newbie-8/time-as-shell-prompt-69973/)

chandan 07-03-2003 10:18 PM

time as shell prompt
 
How to find out time in the terminal.
Is it possible to have time as shell prompt.
Or is it possible to display time in any other part of the screen continuously in the terminal.

fancypiper 07-03-2003 10:52 PM

Put something similar to this in your .bashrc file.

Code:

# Change bash prompt. See the article
# http://www-106.ibm.com/developerwork.../l-tip-prompt/
export PS1='\d \@ \[\e[32;1m\]\u\[\e[34;1m\]@\[\e[36;1m\]\H \[\e[34;1m\]\w\[\e[32;1m\] $ \[\e[0m\]'
# For the root account use this
# export PS1='\d \@ \[\e[31;1m\]\u\[\e[34;1m\]@\[\e[36;1m\]\H \[\e[34;1m\]\w\[\e[31;1m\] # \[\e[0m\]'

Here is my current prompt
Code:

Thu Jul  3 11:52pm phil@tinwhistle ~ $

eltongeoff 07-03-2003 11:45 PM

hey damn nice link

moses 07-04-2003 01:05 AM

Realize that the time in the prompt is static, so if you want the current time, you have to reactivate the prompt (hit ENTER).


All times are GMT -5. The time now is 03:19 PM.