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