1.\" Copyright (c) 1980, 1990 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)lastcomm.1 6.8 (Berkeley) 07/27/91 7.\" 8.Dd 9.Dt LASTCOMM 1 10.Os BSD 3 11.Sh NAME 12.Nm lastcomm 13.Nd show last commands executed in reverse order 14.Sh SYNOPSIS 15.Nm lastcomm 16.Op Fl f Ar file 17.Op Ar command ... 18.Op Ar user ... 19.Op Ar terminal ... 20.Sh DESCRIPTION 21.Nm Lastcomm 22gives information on previously executed commands. 23With no arguments, 24.Nm lastcomm 25prints information about all the commands recorded 26during the current accounting file's lifetime. 27.Pp 28Option: 29.Pp 30.Bl -tag -width Fl 31.It Fl f Ar file 32Read from 33.Ar file 34rather than the default 35accounting file. 36.El 37.Pp 38If called with arguments, only accounting entries with a 39matching 40.Ar command 41name, 42.Ar user 43name, 44or 45.Ar terminal 46name 47are printed. 48So, for example: 49.Pp 50.Dl lastcomm a.out root ttyd0 51.Pp 52would produce a listing of all the 53executions of commands named 54.Pa a.out 55by user 56.Ar root 57on the terminal 58.Ar ttyd0 . 59.Pp 60For each process entry, the following are printed. 61.Pp 62.Bl -bullet -offset indent -compact 63.It 64The name of the user who ran the process. 65.It 66Flags, as accumulated by the accounting facilities in the system. 67.It 68The command name under which the process was called. 69.It 70The amount of cpu time used by the process (in seconds). 71.It 72The time the process exited. 73.El 74.Pp 75The flags are encoded as follows: ``S'' indicates the command was 76executed by the super-user, ``F'' indicates the command ran after 77a fork, but without a following 78.Xr exec , 79``C'' indicates the command was run in PDP-11 compatibility mode 80(VAX only), 81``D'' indicates the command terminated with the generation of a 82.Pa core 83file, and ``X'' indicates the command was terminated with a signal. 84.Sh FILES 85.Bl -tag -width /var/account/acct -compact 86.It Pa /var/account/acct 87Default accounting file. 88.El 89.Sh SEE ALSO 90.Xr last 1 , 91.Xr sigvec 2 , 92.Xr acct 5 , 93.Xr core 5 94.Sh HISTORY 95The 96.Nm lastcomm 97command appeared in 98.Bx 3.0 . 99