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