LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to get timestamp for history command? (https://www.linuxquestions.org/questions/linux-general-1/how-to-get-timestamp-for-history-command-4175519121/)

Ananda Bbau 09-17-2014 12:16 AM

How to get timestamp for history command?
 
Hi Folks,

I need to get output of history command with time format. I have to change it in kernel code and needs to compile the code. Going to install the compiled code in server.

Please help me where to change in kernel code.

Thanks,
G.Ananda Babu.

szboardstretcher 09-17-2014 09:32 AM

That isn't a function of the Kernel AFAIK. It's bash.

Code:

echo "export HISTTIMEFORMAT=\"[%h/%d .. %H:%M:%S] - \"" >> /etc/bashrc
Will give you the time of the command in your history on recent RHEL based distros.


All times are GMT -5. The time now is 08:58 PM.