1.\" Copyright (c) 1980, 1990 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" from: @(#)lastcomm.1 6.8 (Berkeley) 7/27/91 33.\" $Id: lastcomm.1,v 1.2 1993/08/01 07:31:48 mycroft Exp $ 34.\" 35.Dd July 27, 1991 36.Dt LASTCOMM 1 37.Os BSD 3 38.Sh NAME 39.Nm lastcomm 40.Nd show last commands executed in reverse order 41.Sh SYNOPSIS 42.Nm lastcomm 43.Op Fl f Ar file 44.Op Ar command ... 45.Op Ar user ... 46.Op Ar terminal ... 47.Sh DESCRIPTION 48.Nm Lastcomm 49gives information on previously executed commands. 50With no arguments, 51.Nm lastcomm 52prints information about all the commands recorded 53during the current accounting file's lifetime. 54.Pp 55Option: 56.Pp 57.Bl -tag -width Fl 58.It Fl f Ar file 59Read from 60.Ar file 61rather than the default 62accounting file. 63.El 64.Pp 65If called with arguments, only accounting entries with a 66matching 67.Ar command 68name, 69.Ar user 70name, 71or 72.Ar terminal 73name 74are printed. 75So, for example: 76.Pp 77.Dl lastcomm a.out root ttyd0 78.Pp 79would produce a listing of all the 80executions of commands named 81.Pa a.out 82by user 83.Ar root 84on the terminal 85.Ar ttyd0 . 86.Pp 87For each process entry, the following are printed. 88.Pp 89.Bl -bullet -offset indent -compact 90.It 91The name of the user who ran the process. 92.It 93Flags, as accumulated by the accounting facilities in the system. 94.It 95The command name under which the process was called. 96.It 97The amount of cpu time used by the process (in seconds). 98.It 99The time the process exited. 100.El 101.Pp 102The flags are encoded as follows: ``S'' indicates the command was 103executed by the super-user, ``F'' indicates the command ran after 104a fork, but without a following 105.Xr exec , 106``C'' indicates the command was run in PDP-11 compatibility mode 107(VAX only), 108``D'' indicates the command terminated with the generation of a 109.Pa core 110file, and ``X'' indicates the command was terminated with a signal. 111.Sh FILES 112.Bl -tag -width /var/account/acct -compact 113.It Pa /var/account/acct 114Default accounting file. 115.El 116.Sh SEE ALSO 117.Xr last 1 , 118.Xr sigvec 2 , 119.Xr acct 5 , 120.Xr core 5 121.Sh HISTORY 122The 123.Nm lastcomm 124command appeared in 125.Bx 3.0 . 126