LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-19-2007, 01:06 AM   #1
anandkj
LQ Newbie
 
Registered: Jul 2007
Posts: 18

Rep: Reputation: 0
time when a command was executed.


Hi all,
I know that previously executed commands can be listed using "history" command. I'd like to know if i can find the time when a command was executed. Is there any log files from which i can fetch this info? pl let me know.
cheers
anand
 
Old 12-19-2007, 01:15 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
man history:

If the shell variable HISTTIMEFORMAT is set and not null, it is used as a format string for
strftime(3) to display the time stamp associated with each displayed history entry. No intervening blank is printed between the formatted time stamp and the history line.
 
Old 12-19-2007, 01:21 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Note: was introduced in bash 3.x

Older version know nothing about it.



Cheers,
Tink
 
Old 12-21-2007, 01:09 AM   #4
anandkj
LQ Newbie
 
Registered: Jul 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Thanks!!!

hi there,
thanks a lot! appending HISTTIME="%D %T " to .bashrc worked! thanks again
rgds
anand
 
  


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
rc.local isn't executed at boot time elvijs Slackware 3 06-24-2007 06:48 AM
how to see which command has been executed ? Volcano Linux - Newbie 4 12-11-2006 08:48 AM
which command executed on which terminal dsids Linux - Newbie 1 09-23-2006 08:57 AM
Cron jobs not executed at right time(persistent UTC?) baddah Linux - Newbie 2 03-29-2006 11:27 PM
Commands executed at boot time Johnburrell Linux From Scratch 3 09-18-2005 01:56 PM

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

All times are GMT -5. The time now is 09:18 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