LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to put date and timestamp to bash_history ? (https://www.linuxquestions.org/questions/linux-general-1/how-to-put-date-and-timestamp-to-bash_history-764961/)

dlugasx 10-28-2009 03:25 AM

how to put date and timestamp to bash_history ?
 
Hi all,

question like in the subject.

how to put date and timestamp to bash_history ?

I havent seen any good informations on the google.


help...


Dlugasx

rhadmn 10-28-2009 03:38 AM

Hi Dlugasx,

Actually i dint understand your question.As for the other files in the LINUX, .bash_profile will also be having a date & timestamp.Kind request to please describe your query/issue u r facing in detail...

Regards,
RHADMN

dlugasx 10-28-2009 03:45 AM

Quote:

Originally Posted by rhadmn (Post 3735040)
Hi Dlugasx,

Actually i dint understand your question.As for the other files in the LINUX, .bash_profile will also be having a date & timestamp.Kind request to please describe your query/issue u r facing in detail...

Regards,
RHADMN


If You know what for is bash_history, its easy to understand.



try to execute command: history

do You see when each command has been executed ?


1001 2008-07-31 19:42:46 command1
1002 2008-07-31 19:42:54 command2
1003 2008-07-31 19:43:00 command3
1004 2008-07-31 19:43:25 ...



I have found nice tutorial how to format bash_profile.


Thanks! Post is solved...



http://www.zarrelli.org/blog/2008/07...y-time-format/

rhadmn 10-28-2009 05:03 AM

History With Date/Time Stamp
 
Quote:

Originally Posted by dlugasx (Post 3735044)
If You know what for is bash_history, its easy to understand.



try to execute command: history

do You see when each command has been executed ?


1001 2008-07-31 19:42:46 command1
1002 2008-07-31 19:42:54 command2
1003 2008-07-31 19:43:00 command3
1004 2008-07-31 19:43:25 ...



I have found nice tutorial how to format bash_profile.


Thanks! Post is solved...



http://www.zarrelli.org/blog/2008/07...y-time-format/



Thanks for the info !!

unSpawn 10-28-2009 03:59 PM

Note thought that while this web log presents its solution, which you could get from reading the Bash manual page anyway, in a next best thing to sliced bread kind of way it fails to mention that this will only work with recent Bash versions. It is not backward compatible as well.


All times are GMT -5. The time now is 10:51 PM.