Help answer threads with 0 replies.
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: 51

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,450

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
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

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

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