File: lastcomm.1

package info (click to toggle)
acct 6.5.4-2.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,132 kB
  • ctags: 1,428
  • sloc: sh: 10,390; ansic: 9,695; cpp: 289; makefile: 185
file content (204 lines) | stat: -rw-r--r-- 3,998 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
.TH LASTCOMM 1 "1995 October 31"
.SH NAME
lastcomm \-  print out information about previously executed commands.
.SH SYNOPSIS
.hy 0
.na
.TP
.B lastcomm
[
.I command-name ...
]
.br
[
.I user-name ...
]
.br
[
.I terminal-name ...
]
.br
[ 
.B \-\-strict-match
]
.br
[
.B \-\-forwards
]
.br
[
.BI \-f " filename"
|
.BI \-\-file " filename"
]
[
.BI \-\-ahz " hz"
]
.br
[
.B \-\-user
.I name
]
[
.B \-\-command
.I name
]
[
.B \-\-tty
.I name
]
.br
[
.B \p
|
.B \-\-show_paging
]
[
.B \-\-debug
]
[
.B \-V
|
.B \-\-version 
]
[
.B \-h
|
.B \-\-help 
]
.ad b
.hy 1
.SH DESCRIPTION
.LP
.B lastcomm
prints out information about previously executed
commands.  If no arguments are specified, 
.B lastcomm 
will print info
about all of the commands in 
.I acct
(the record file).  If called with one or more of
.I command-name,
.I user-name, 
or 
.I terminal-name,
only records containing those items will be displayed.  For 
example, to find out which users used command `a.out' 
and which users were logged into `tty0', type:
.ce
lastcomm a.out tty0
.ce 0
.LP
This will print any entry for which `a.out' or `tty0' 
matches in any of the record's fields (command, name, or terminal).  If 
you want to find only items that match *all* of the arguments on the command 
line, you must use the '\-strict-match' option.  For example, to list 
all of the executions of command 
.IR a.out " by user " root " on terminal " tty0, 
type:
.ce 
lastcomm \-\-strict-match \-\-command a.out \-\-user root \-\-tty tty0
.ce 0
.LP
The order of the arguments is not important.
.LP
For each entry the following information is printed:
   + command name of the process
   + flags, as recorded by the system accounting routines:
        S -- command executed by super-user
        F -- command executed after a fork but without a following exec
        C -- command run in PDP-11 compatibility mode (VAX only)
        D -- command terminated with the generation of a core file
        X -- command was terminated with the signal SIGTERM
   + the name of the user who ran the process
   + time the process started
.SH OPTIONS
.PD 0
.TP
.B \-\-strict-match
Print only entries that match *all* of the arguments on the command
line.
.TP
.BI \-\-user " name"
List records for user with
.I name.
This is useful if you're trying
to match a username that happens to be the same as a command (e.g.,
.I ed
).
.TP
.BI \-\-command " name"
List records for command
.I name.
.TP
.BI \-\-tty " name"
List records for tty
.I name.
.TP
.BI \-\-forwards
Read file forwards instead of backwards. This avoids trying to seek on the file
and can be used to read from a pipe. This must be specified prior to any
.BI \-f
arguments.
.TP
.BI \-f " filename, " \-\-file " filename"
Read from the file 
.I filename 
instead of
.I acct.
A filename of "-" will result in reading from stdin. This must either be the
first
.BI \-f
option, or
.BI \-\-forwards
must precede all
.BI \-f
options.
.TP
.BI \-\-ahz " hz"
Use this flag to tell the program what
.B AHZ
should be (in hertz).  This option is useful if you are trying to view
an
.I acct
file created on another machine which has the same byte order and file
format as your current machine, but has a different value for
.B AHZ.
.TP
.B \-p, \-\-show\-paging
Print paging statistics
.TP
.B \-\-debug
Print verbose internal information.
.TP
.B \-V, \-\-version
Print the version number of
.B lastcomm.
.TP
.B \-h, \-\-help
Prints the usage string and default locations of system files to
standard output and exits.

.SH FILES
.I acct
.RS
The system wide process accounting file. See
.BR acct (5)
(or
.BR pacct (5))
for further details.
.I /var/log/account
.RS
This directory contains pacct files which contain the binary process
accounting data as written by the kernel.
.RE
.LP

.SH AUTHOR
The GNU accounting utilities were written by Noel Cragg
<noel@gnu.ai.mit.edu>. The man page was adapted from the accounting
texinfo page by Susan Kleinmann <sgk@sgk.tiac.net>.
.SH "SEE ALSO"
.BR last (1),
.BR acct (5)