Capture command line entry with timestamp
Hi guys! Have been working on Redhat 9 for about 6 months. I 'm just wondering, if it's possible to capture command line entries ( bash etc ) into a text file with a timestamp. Of course, it should not capture password and stuff. Is this possible?
Need advice, Moxsha |
"Hi guys! Have been working on Redhat 9 for about 6 months. I 'm just wondering, if it's possible to capture command line entries ( bash etc ) into a text file with a timestamp. Of course, it should not capture password and stuff. Is this possible?"
You can use the HISTFILE and HISTFILESIZE variables to keep a command log. For example you could put the following commands at the end of your .bashrc file: HISTFILE=/home/user/command.log HISTFILESIZE= 10000 export HISTFILE export HISTFILESIZE and bash will keep the last 10000 commands in /home/user/command.log. I do not know how to time stamp the commands. I think that bash would not have such an option because altering the commands would make them unreusable and defeat the main purpose of the bash history file. You already have such a file in .bash_history and you can call up your previous commands with up arrow. ___________________________________ Be prepared. Create a LifeBoat CD. http://users.rcn.com/srstites/LifeBo...home.page.html Steve Stites |
omg where did it go
omg where did it all go
|
you might also try the script command.
|
All times are GMT -5. The time now is 09:38 AM. |