URGENT! Is there any command to get a history command lines and time in SUSE Linux.?
I have to trace back what command and when it is used for the last 3 months. It is quite urgent as I have trouble with the system configuration... Please help me.
Thank you in advance. |
What shell do you use? If it's bash, then
You can find the last 500 commands in your ~/.bash_history file (that is, unless you set the variables $HISTFILE and $HISTFILESIZE to some other values). The file does NOT keep the dates. I don't know any other location that would save the commands you enter by default. |
Exactly as Uncle_Theodore says; I too don't know/believe that the history is preserved anywhere other than its usual place (wherever that is-- inside .bash_history I think) but: FWIW, it goes by number of commands, not time/date, and while I have my bash history set in the thousands of commands, it sometimes *still* isn't enough, even over a several-day period, :confused: so for your future reference, perhaps you should consider setting your history to a very large number.
Sasha |
Thank you so much Uncle_Theodore and GrapefruiTgirl for the advice.
Have a very good day. IGSoper |
To keep the dates you have to set the environment variable HISTTIMEFORMAT. You can assign a format similar to that ones of the command date. For example:
Code:
export HISTTIMEFORMAT="%Y%m%d %H:%M:%S " Code:
20090623 08:19:13 date |
Colucix, Thank you so much for the advice. I shall try it. :)
|
All times are GMT -5. The time now is 11:10 PM. |