SUMMARY: History of commands in tcsh shell

From: alan.nguyen@au.transport.bombardier.com
Date: Thu Jan 02 2003 - 18:30:29 EST


I would like to thank Jim Belonis, James Sainsbury, Paul A Sand, Mike caplin
very much for your instant help. I appreciated it.

Below is my question and the answers.
Question:
> Is there any way to save the last executed commands into a file ?
> The lastcomm shows only the current day.

Answers:
lastcomm actually gets all program-running commands (not just in tcsh).
It gets them out of the accounting file /usr/adm/pacct
so accounting has to be turned on.

In addition, there is a tcsh history file which you can keep
and you can set the maximum length of that file
(find 'history' in man tcsh). That is well documented, so I won't talk about
that further here.

In order to expand lastcomm, you have to modify the accounting script
to save the old accounting files instead of deleting them.
And then view with the acctcom command instead of lastcomm
so you can point to the right saved file.
Alternatively, if you want to continue to use unmodified 'lastcomm'
you could modify the accounting script and/or related crontab entries
to remove /var/adm/pacct at longer intervals but I've never tried that.

-------------------------------------------------------------
In ~/.cshrc or ~/.tcshrc

     set savehist=100

lastcomm reads /var/adm/pacct by default so I assume the pacct file
is being rotated daily or truncated daily.
See accton(8) etc

You may also wish to explore the auditing capabilities of tru64.
See audit_setup(8)

---------------------------------------------------------------

Alan.Nguyen@au.transport.bombardier.com



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:49:02 EDT