LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 06-24-2007, 04:20 PM   #1
JRR883
Member
 
Registered: Aug 2005
Location: God's barf bag
Distribution: Ubuntu 7.04 (Feisty Fawn)
Posts: 86

Rep: Reputation: 15
Timestamp in gnome-terminal?


Does anyone know of a way to put a timestamp in gnome-terminal? Sometimes I like to know how long my fabulous new Thinkpad T60p takes to complete tasks without having to stare at the clock.
 
Old 06-24-2007, 05:10 PM   #2
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 292Reputation: 292Reputation: 292
You could change your prompt to show time:
Code:
grey="\[\033[0;37m\]"
white="\e[01;37m"
PS1="${white}\w \@ ;) ${grey}"
PS1 is the variable that holds your bash prompt style and \@ is the symbol for the time. Put this in your ~/.bashrc

Last edited by dive; 06-24-2007 at 05:12 PM.
 
Old 06-24-2007, 05:36 PM   #3
JRR883
Member
 
Registered: Aug 2005
Location: God's barf bag
Distribution: Ubuntu 7.04 (Feisty Fawn)
Posts: 86

Original Poster
Rep: Reputation: 15
I added those lines to my ~/.bashrc, all it did was turn the text that usually shows user@desktop:~$ white, and the input text grey. I also tried adding it to my /root/.bashrc to no avail.
 
Old 06-25-2007, 01:11 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,017

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Try time command
eg:
Code:
# time locate -u

real    0m0.398s
user    0m0.268s
sys     0m0.128s
#
 
Old 06-25-2007, 04:30 AM   #5
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,211

Rep: Reputation: 292Reputation: 292Reputation: 292
Quote:
Originally Posted by JRR883
I added those lines to my ~/.bashrc, all it did was turn the text that usually shows user@desktop:~$ white, and the input text grey. I also tried adding it to my /root/.bashrc to no avail.
Strange. Maybe Ubuntu uses a different set of vars for PS1 then...

Google for 'ubuntu bash prompt' maybe

*Edit: just found this. May be worth asking here:

http://ubuntuforums.org/showthread.php?t=31247

Last edited by dive; 06-25-2007 at 04:47 AM.
 
Old 06-25-2007, 06:47 AM   #6
JRR883
Member
 
Registered: Aug 2005
Location: God's barf bag
Distribution: Ubuntu 7.04 (Feisty Fawn)
Posts: 86

Original Poster
Rep: Reputation: 15
I figured it out. I edited my .bashrc for root and user to include \T in PS1. I changed the line defining PS1 (line 29 in Ubuntu Feisty) from
Code:
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$
to
Code:
PS1='${debian_chroot:+($debian_chroot)}\T_\u@\h:\w\$
. Now my prompt displays 06:41:24_me@riley-laptop:~$. Here are the variables for the different time displays:

# \t the current time in 24-hour HH:MM:SS format
# \T the current time in 12-hour HH:MM:SS format
# \@ the current time in 12-hour am/pm format
# \A the current time in 24-hour HH:MM format

Thanks guys, and I hope this helps anyone else with the problem.
 
  


Reply

Tags
gnometerminal, terminal, timestamp


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
pressing 'x' in gnome terminal starts new terminal instance Drwfan54 Ubuntu 3 09-26-2006 03:09 PM
Changing environment variable for gnome session from gnome-terminal pymehta Linux - Software 1 10-11-2005 05:19 PM
Alternative terminal to konsole & gnome-terminal Adony Linux - Software 3 10-08-2004 03:59 AM
Gnome 2.6 problems (gnome-terminal) ababkin Linux - Software 1 04-05-2004 12:57 PM
Gnome terminal Hone101 Linux - Newbie 9 11-21-2003 11:46 AM


All times are GMT -5. The time now is 06:38 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration