LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-03-2003, 10:18 PM   #1
chandan
Member
 
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, 10:52 PM   #2
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 60
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 ~ $

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

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

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


Reply



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 12:15 AM
Different name at shell prompt XJNick Linux - General 3 08-25-2005 10:20 AM
Shell Prompt xneowolf Linux - General 5 01-26-2003 02:06 AM
Shell prompt setup NSKL Linux - Newbie 1 06-15-2002 11:55 AM
C shell prompt robson Linux - General 2 11-12-2001 08:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:13 PM.

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