1lastcomm(1) User Commands lastcomm(1)
2
3
4
6 lastcomm - display the last commands executed, in reverse order
7
9 lastcomm [-f file] [-x] [command-name] ... [user-name] ...
10 [terminal-name] ...
11
12
14 The lastcomm command gives information on previously executed commands.
15 lastcomm with no arguments displays information about all the commands
16 recorded during the current accounting file's lifetime. If called with
17 arguments, lastcomm only displays accounting entries with a matching
18 command-name, user-name, or terminal-name. If extended process account‐
19 ing is active (see acctadm(1M)) and is recording the appropriate data
20 items, lastcomm attempts to take data from the current extended process
21 accounting file. If standard process accounting is active, lastcomm
22 takes data from the current standard accounting file (see acct(2)).
23
24
25 If terminal-name is `- -', there was no controlling TTY for the
26 process. The process was probably executed during boot time. If termi‐
27 nal-name is `??', the controlling TTY could not be decoded into a
28 printable name.
29
30
31 For each process entry, lastcomm displays the following items of infor‐
32 mation:
33
34 o The command name under which the process was called.
35
36 o One or more flags indicating special information about the
37 process. The flags have the following meanings:
38
39
40 F The process performed a fork but not an exec.
41
42
43 S The process ran as a set-user-id program.
44
45
46
47 o The name of the user who ran the process.
48
49 o The terminal which the user was logged in on at the time (if
50 applicable).
51
52 o The amount of CPU time used by the process (in seconds).
53
54 o The date and time the process exited.
55
57 The following options are supported:
58
59 -f file Uses file as the source of accounting data. file may be
60 either an extended process accounting file or a standard
61 process accounting file.
62
63
64 -x Uses the currently active extended process accounting file.
65 If extended processing accounting is inactive, no output
66 will be produced.
67
68
70 Example 1 Listing executions of named commands
71
72
73 The command
74
75
76 example% lastcomm a.out root term/01
77
78
79
80
81 produces a listing of all the executions of commands named a.out by
82 user root while using the terminal term/01.
83
84
85 Example 2 Listing all user commands
86
87
88 The command
89
90
91 example% lastcomm root
92
93
94
95
96 produces a listing of all the commands executed by user root.
97
98
100 /var/adm/pacct standard accounting file
101
102
103 /var/adm/exacct/proc extended accounting file
104
105
107 See attributes(5) for descriptions of the following attributes:
108
109
110
111
112 ┌─────────────────────────────┬─────────────────────────────┐
113 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
114 ├─────────────────────────────┼─────────────────────────────┤
115 │Availability │SUNWesu │
116 └─────────────────────────────┴─────────────────────────────┘
117
119 last(1), acctadm(1M), acct(2), acct.h(3HEAD), sigvec(3UCB), core(4),
120 attributes(5)
121
122
123
124SunOS 5.11 10 Jan 2000 lastcomm(1)