System Administration
Showing results for 
Search instead for 
Did you mean: 

Sort of .sh_history by date and time?

Steven Roberts
Occasional Visitor

Sort of .sh_history by date and time?

Is there a way to sort the .sh_history file for a user by the date and time of each command?

And is there a way to set it so that the date and time appears in the .sh_history file?
Frequent Advisor

Re: Sort of .sh_history by date and time?

Hi Roberts,

few hints here.

1. in login shell script, echo `date` >> /path_to/.sh_history.

2. in login or logout shell script, rename old file with date suffix.

3. audit can be turned on in order to trace footprints.

have fun !