xref: /netbsd-src/usr.bin/lastcomm/lastcomm.1 (revision d16b7486a53dcb8072b60ec6fcb4373a2d0c27b7)
1.\"	$NetBSD: lastcomm.1,v 1.12 2012/01/31 16:30:40 christos Exp $
2.\"
3.\" Copyright (c) 1980, 1990, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"	@(#)lastcomm.1	8.1 (Berkeley) 6/6/93
31.\"
32.Dd January 31, 2012
33.Dt LASTCOMM 1
34.Os
35.Sh NAME
36.Nm lastcomm
37.Nd show last commands executed in reverse order
38.Sh SYNOPSIS
39.Nm
40.Op Fl w
41.Op Fl f Ar file
42.Op Ar command ...
43.Op Ar user ...
44.Op Ar terminal ...
45.Sh DESCRIPTION
46.Nm
47gives information on previously executed commands.
48With no arguments,
49.Nm
50prints information about all the commands recorded
51during the current accounting file's lifetime.
52.Pp
53Option:
54.Pp
55.Bl -tag -width Fl
56.It Fl f Ar file
57Read from
58.Ar file
59rather than the default
60accounting file.
61.It Fl w
62Use as many columns as needed to print the output instead of limiting it to 80.
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 started.
100.It
101The elapsed time of the process.
102.El
103.Pp
104The flags are encoded as follows:
105.Dq S
106indicates the command was
107executed by the super-user,
108.Dq F
109indicates the command ran after
110a fork, but without a following
111.Xr exec 3 ,
112.Dq C
113indicates the command was run in PDP-11 compatibility mode
114(VAX only),
115.Dq D
116indicates the command terminated with the generation of a
117.Pa core
118file, and
119.Dq X
120indicates the command was terminated with a signal.
121.Pp
122The
123.Dq S
124and
125.Dq C
126flags are no longer recorded by the system, but will be reported by
127.Nm
128when reading from an accounting file generated by an older version
129of the system.
130.Sh FILES
131.Bl -tag -width /var/account/acct -compact
132.It Pa /var/account/acct
133Default accounting file.
134.El
135.Sh SEE ALSO
136.Xr last 1 ,
137.Xr sigaction 2 ,
138.Xr acct 5 ,
139.Xr core 5
140.Sh HISTORY
141The
142.Nm
143command appeared in
144.Bx 3.0 .
145