LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 08-16-2011, 05:00 AM   #1
crahuldba@gmail.com
Member
 
Registered: Apr 2010
Posts: 50

Rep: Reputation: 2
Unix history with date and time


Hello Friends
I know that if we set the HISTTIMEFORMAT variable
like
HISTTIMEFORMAT="%d/%m/%y %T "

Then we can see the time and date of the command execution
but it apply only the commands fired after setting the variable

what if we want to check the time and date of the commands fired before setting this variable can any one give any succession about it.

Thanks
Rahul Sharma
 
Old 08-16-2011, 07:24 AM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,061

Rep: Reputation: 769Reputation: 769Reputation: 769Reputation: 769Reputation: 769Reputation: 769Reputation: 769
You would need to set the format system-wide and restart the system for it to take effect. I'm not familiar with Fedora and do not know where basic environment variables are set (somewhere in /etc) system-wide. You could set the variable in /etc/profile and accomplish that -- every user would, on log in, would have that variable set.

History prior to setting the environment variable will not contain the time stamp; the history file resides in your home directory and is appended with each new command entered -- it's not in a data base somewhere.

Hope this helps some.
 
  


Reply


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
How can I append the date/time stamp to commands in history? abefroman Linux - Security 2 05-29-2008 11:21 AM
how to convert windows date and time to unix date and time jitupatil_2007 General 8 03-31-2008 05:58 AM
Convert Normal Date to Unix Time gbratig AIX 5 06-02-2007 03:46 PM


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