Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-03-2003, 11:18 PM   #1
Registered: Feb 2003
Location: Bangalore, India
Distribution: Fedora Core 2
Posts: 60

Rep: Reputation: 15
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.
Old 07-03-2003, 11:52 PM   #2
LQ Guru
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
Put something similar to this in your .bashrc file.

# Change bash prompt. See the article
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
Thu Jul  3 11:52pm phil@tinwhistle ~ $

Last edited by fancypiper; 07-03-2003 at 11:54 PM.
Old 07-04-2003, 12:45 AM   #3
Registered: Mar 2003
Posts: 76

Rep: Reputation: 15
hey damn nice link
Old 07-04-2003, 02:05 AM   #4
Senior Member
Registered: Sep 2002
Location: Arizona, US, Earth
Distribution: Slackware, (Non-Linux: Solaris 7,8,9; OSX; BeOS)
Posts: 1,152

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
What does your shell prompt look like? david_ross Linux - General 50 04-01-2011 01:15 AM
Different name at shell prompt XJNick Linux - General 3 08-25-2005 11:20 AM
Shell Prompt xneowolf Linux - General 5 01-26-2003 03:06 AM
Shell prompt setup NSKL Linux - Newbie 1 06-15-2002 12:55 PM
C shell prompt robson Linux - General 2 11-12-2001 09:08 PM

All times are GMT -5. The time now is 01:16 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration