Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 05-18-2005, 08:33 AM   #1
Registered: Mar 2005
Location: the thrid rock from the sun
Distribution: Red Hat 8, FC 3
Posts: 31

Rep: Reputation: 15
display time in the prompt


the following string displays time in the prompt:

set prompt = "%{\033[29m%}%B[%@]$ "

as follows:


now i want the time in 24 hours format, without any am, pm etc. that is, say


anybody knows how?


Last edited by rpb; 05-18-2005 at 08:36 AM.
Old 05-18-2005, 04:03 PM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,893

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
The answer can be found in the Bash Prompt HOWTO. Change %@ to %t (or possibly \t as in the HOWTO) for time in 24 hour format.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
about time display in redhat 9 yjiang Linux - General 1 10-26-2004 11:02 PM
Display the date and time from another time zone lothario Linux - Software 4 07-31-2004 03:27 PM
Telling ls to display one screen at a time rl5 Linux - Newbie 3 03-23-2004 07:29 PM
how set system time by command prompt? yenonn Linux - Newbie 9 08-25-2003 06:40 PM
time as shell prompt chandan Linux - Newbie 3 07-04-2003 01:05 AM > Forums > Linux Forums > Linux - General

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

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