xref: /dragonfly/usr.bin/lastcomm/lastcomm.1 (revision 2cd2d2b5)
1.\" Copyright (c) 1980, 1990, 1993
2.\"	The Regents of the University of California.  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	8.1 (Berkeley) 6/6/93
33.\" $FreeBSD: src/usr.bin/lastcomm/lastcomm.1,v 1.7.2.4 2002/06/21 15:27:39 charnier Exp $
34.\" $DragonFly: src/usr.bin/lastcomm/lastcomm.1,v 1.2 2003/06/17 04:29:27 dillon Exp $
35.\"
36.Dd September 18, 1996
37.Dt LASTCOMM 1
38.Os
39.Sh NAME
40.Nm lastcomm
41.Nd show last commands executed in reverse order
42.Sh SYNOPSIS
43.Nm
44.Op Fl EScesu
45.Op Fl f Ar file
46.Op Ar command ...\&
47.Op Ar user ...\&
48.Op Ar terminal ...\&
49.Sh DESCRIPTION
50The
51.Nm
52utility gives information on previously executed commands.
53With no arguments,
54.Nm
55prints information about all the commands recorded
56during the current accounting file's lifetime.
57.Pp
58The following options are available:
59.Pp
60.Bl -tag -width XXfXfileX -compact
61.Pp
62.It Fl E
63Print the time the process exited.
64.It Fl S
65Print the time the process started.
66.It Fl c
67Print the amount of cpu time used by the process.
68.It Fl e
69Print the amount of elapsed time used by the process.
70.It Fl s
71Print the amount of system time used by the process.
72.It Fl u
73Print the amount of user time used by the process.
74.It Fl f Ar file
75Read from
76.Ar file
77rather than the default
78.Pa /var/account/acct .
79.El
80.Pp
81If no options are specified,
82.Fl cS
83is assumed.
84If
85.Nm
86is invoked with arguments, only accounting entries with a
87matching
88.Ar command
89name,
90.Ar user
91name,
92or
93.Ar terminal
94name
95are printed.
96For example:
97.Pp
98.Dl lastcomm a.out root ttyd0
99.Pp
100would produce a listing of all the
101executions of commands named
102.Pa a.out
103by user
104.Ar root
105on the terminal
106.Ar ttyd0  .
107.Pp
108For each process entry, the following are printed.
109.Pp
110.Bl -bullet -offset indent -compact
111.It
112The name of the user who ran the process.
113.It
114Flags, as accumulated by the accounting facilities in the system.
115.It
116The command name under which the process was called.
117.It
118The amount of
119CPU
120.Pq Fl c ,
121wall
122.Pq Fl e ,
123system
124.Pq Fl s ,
125or user
126.Pq Fl u
127time used by the process (in seconds).
128.It
129The time the process started
130.Pq Fl S
131or exited
132.Pq Fl E .
133.El
134.Pp
135The flags are encoded as follows: ``S'' indicates the command was
136executed by the super-user, ``F'' indicates the command ran after
137a fork, but without a following
138.Xr exec 3 ,
139.\" ``C'' indicates the command was run in PDP-11 compatibility mode
140.\" (VAX only),
141``D'' indicates the command terminated with the generation of a
142.Pa core
143file, and ``X'' indicates the command was terminated with a signal.
144.Sh FILES
145.Bl -tag -width /var/account/acct -compact
146.It Pa /var/account/acct
147Default accounting file.
148.El
149.Sh SEE ALSO
150.Xr last 1 ,
151.Xr sigvec 2 ,
152.Xr acct 5 ,
153.Xr core 5
154.Sh HISTORY
155The
156.Nm
157command appeared in
158.Bx 3.0 .
159