Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-16-2011, 05:00 AM   #1
Registered: Apr 2010
Posts: 52

Rep: Reputation: 2
Unix history with date and time

Hello Friends
I know that if we set the HISTTIMEFORMAT variable

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.

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

Rep: Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060Reputation: 1060
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.


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 > Forums > Linux Forums > Linux - Newbie

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