From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: alan.nguyen@au.transport.bombardier.com Newsgroups: gmane.os.tru64.managers Subject: SUMMARY: History of commands in tcsh shell Date: Fri, 03 Jan 2003 09:30:29 +1000 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1041546673 10004 80.91.224.249 (2 Jan 2003 22:31:13 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 2 Jan 2003 22:31:13 +0000 (UTC) Return-path: Original-Received: from sws1.ctd.ornl.gov ([160.91.20.101]) by main.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 18UDrI-0002YL-00 for ; Thu, 02 Jan 2003 23:30:37 +0100 Original-Received: (qmail 31468 invoked by uid 5); 2 Jan 2003 22:31:21 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 31459 invoked by uid 49493); 2 Jan 2003 22:31:21 -0000 Original-Received: from alan.nguyen@au.transport.bombardier.com by sws1 by uid 49491 with qmail-scanner-1.14 (clamscan: 0.54. spamassassin: 2.50-cvs. Clear:SA:0(-4.5/5.0):. Processed in 0.409481 secs); 02 Jan 2003 22:31:21 -0000 Original-Received: from unknown (HELO emroute3.ornl.gov) (160.91.4.110) by 0 with SMTP; 2 Jan 2003 22:31:21 -0000 Original-Received: from emroute3.ornl.gov (localhost [127.0.0.1]) by emroute3.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H8300H4ZYK8KU@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 02 Jan 2003 17:31:20 -0500 (EST) Original-Received: from demas002.adtranz.com (demas002.adtranz.com [213.68.98.31]) by emroute3.ornl.gov (PMDF V6.1-1 #39060) with ESMTP id <0H8300J15YJD96@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Thu, 02 Jan 2003 17:30:50 -0500 (EST) Original-Received: from de.transport.bombardier.com (demalng2 [53.191.115.105]) by demas002.adtranz.com (8.12.5/8.12.5) with SMTP id h02MUlHI005919 for ; Thu, 02 Jan 2003 23:30:48 +0100 (MET) Original-Received: by de.transport.bombardier.com(Lotus SMTP MTA v4.6.7 (934.1 12-30-1999)) id C1256CA2.007BA8CA ; Thu, 02 Jan 2003 23:30:41 +0100 Original-To: tru64-unix-managers@ornl.gov Content-Disposition: inline X-Lotus-FromDomain: TRANSPORT Xref: main.gmane.org gmane.os.tru64.managers:2835 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:2835 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