tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: History of commands in tcsh shell
@ 2003-01-02 23:30 alan.nguyen
  0 siblings, 0 replies; only message in thread
From: alan.nguyen @ 2003-01-02 23:30 UTC (permalink / raw)


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




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-01-02 23:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-02 23:30 SUMMARY: History of commands in tcsh shell alan.nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox