]> git.saurik.com Git - apple/shell_cmds.git/blob - lastcomm/lastcomm.1
shell_cmds-17.1.tar.gz
[apple/shell_cmds.git] / lastcomm / lastcomm.1
1 .\" $NetBSD: lastcomm.1,v 1.7 1997/10/19 03:47:52 lukem 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. All advertising materials mentioning features or use of this software
15 .\" must display the following acknowledgement:
16 .\" This product includes software developed by the University of
17 .\" California, Berkeley and its contributors.
18 .\" 4. Neither the name of the University nor the names of its contributors
19 .\" may be used to endorse or promote products derived from this software
20 .\" without specific prior written permission.
21 .\"
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" SUCH DAMAGE.
33 .\"
34 .\" @(#)lastcomm.1 8.1 (Berkeley) 6/6/93
35 .\"
36 .Dd June 6, 1993
37 .Dt LASTCOMM 1
38 .Os BSD 3
39 .Sh NAME
40 .Nm lastcomm
41 .Nd show last commands executed in reverse order
42 .Sh SYNOPSIS
43 .Nm
44 .Op Fl f Ar file
45 .Op Ar command ...
46 .Op Ar user ...
47 .Op Ar terminal ...
48 .Sh DESCRIPTION
49 .Nm
50 gives information on previously executed commands.
51 With no arguments,
52 .Nm
53 prints information about all the commands recorded
54 during the current accounting file's lifetime.
55 .Pp
56 Option:
57 .Pp
58 .Bl -tag -width Fl
59 .It Fl f Ar file
60 Read from
61 .Ar file
62 rather than the default
63 accounting file.
64 .El
65 .Pp
66 If called with arguments, only accounting entries with a
67 matching
68 .Ar command
69 name,
70 .Ar user
71 name,
72 or
73 .Ar terminal
74 name
75 are printed.
76 So, for example:
77 .Pp
78 .Dl lastcomm a.out root ttyd0
79 .Pp
80 would produce a listing of all the
81 executions of commands named
82 .Pa a.out
83 by user
84 .Ar root
85 on the terminal
86 .Ar ttyd0 .
87 .Pp
88 For each process entry, the following are printed.
89 .Pp
90 .Bl -bullet -offset indent -compact
91 .It
92 The name of the user who ran the process.
93 .It
94 Flags, as accumulated by the accounting facilities in the system.
95 .It
96 The command name under which the process was called.
97 .It
98 The amount of cpu time used by the process (in seconds).
99 .It
100 The time the process started.
101 .It
102 The elapsed time of the process.
103 .El
104 .Pp
105 The flags are encoded as follows: ``S'' indicates the command was
106 executed by the super-user, ``F'' indicates the command ran after
107 a fork, but without a following
108 .Xr exec ,
109 ``C'' indicates the command was run in PDP-11 compatibility mode
110 (VAX only),
111 ``D'' indicates the command terminated with the generation of a
112 .Pa core
113 file, and ``X'' indicates the command was terminated with a signal.
114 .Sh FILES
115 .Bl -tag -width /var/account/acct -compact
116 .It Pa /var/account/acct
117 Default accounting file.
118 .El
119 .Sh SEE ALSO
120 .Xr last 1 ,
121 .Xr sigaction 2 ,
122 .Xr acct 5 ,
123 .Xr core 5
124 .Sh HISTORY
125 The
126 .Nm
127 command appeared in
128 .Bx 3.0 .