.sh_history file related question

Hello everyone,

We all know that there a file called .bash_history file in every users' directory which contains commands the user has executed in the shell.

It does not contain the date and time. I want that the command is entered in this file with date and time like the example shown below

24/12/2005

2:00 am ls -lrt

2:01 am chkconfig and so on

Do anybody has any suggestins regarding this pls advice me what to do

Regards

sunil

[495 byte] By [SunilMahajanjk] at [2007-11-25 23:40:14]
# 1
I'm not quite sure I understand but you want to display the date/time whenever a user logs in ? That is very easy; just take a closer look at the "date" command, you can basicly display these any way you want.
LionO at 2007-7-5 18:48:05 > top of Java-index,General,Sys Admin Best Practices...
# 2
No, I think he wants to log commands in the .sh files to see when a particular command was executed. No, I don't know of any way off hand....
richpierson at 2007-7-5 18:48:05 > top of Java-index,General,Sys Admin Best Practices...
# 3
Try moving your users from bash to zsh.zsh has been bundled since Sol 9 at least, and was at least on the companion cd for Sol 8.zsh has many improvements over bash, including timestamps. It carries forward the best parts of ksh, csh, bash, and tcsh.
toddc051905 at 2007-7-5 18:48:05 > top of Java-index,General,Sys Admin Best Practices...
# 4

Then I do not think this to be possible since bash simply doesn't support this to my knowledge. I also consider this to be a rather intrusive method, really unneeded if you have some trust in your system.

Instead I'd advice to take a closer took at Solaris' auditing which is much more effective and won't be easily turned off by your users (you are aware that the history can be quickly turned off?).

Check http://docs.sun.com/app/docs/doc/816-4557/6maosrjog?a=view for some auditing information.

LionO at 2007-7-5 18:48:05 > top of Java-index,General,Sys Admin Best Practices...