1last(1) User Commands last(1)
2
3
4
6 last - display login and logout information about users and terminals
7
9 last [-a] [-n number | -number] [-f filename]
10 [name | tty]...
11
12
14 The last command looks in the /var/adm/wtmpx file, which records all
15 logins and logouts, for information about a user, a terminal, or any
16 group of users and terminals. Arguments specify names of users or ter‐
17 minals of interest. If multiple arguments are given, the information
18 applicable to any of the arguments is printed. For example, last root
19 console lists all of root's sessions, as well as all sessions on the
20 console terminal. last displays the sessions of the specified users and
21 terminals, most recent first, indicating the times at which the session
22 began, the duration of the session, and the terminal on which the ses‐
23 sion took place. last also indicates whether the session is continuing
24 or was cut short by a reboot.
25
26
27 The pseudo-user reboot logs in when the system is shutdown and when it
28 reboots. Thus,
29
30 last reboot
31
32
33
34
35 gives an approximate record of when the operating system instance was
36 shutdown and when it rebooted. This can be used to calculate the avail‐
37 ability of the operating system over time.
38
39
40 last with no arguments displays a record of all logins and logouts, in
41 reverse order.
42
43
44 If last is interrupted, it indicates how far the search has progressed
45 in /var/adm/wtmpx. If interrupted with a quit signal (generated by a
46 CTRL−\), last indicates how far the search has progressed, and then
47 continues the search.
48
50 The following options are supported:
51
52 -a Displays the hostname in the last column.
53
54
55 -f filename Uses filename as the name of the accounting
56 file instead of /var/adm/wtmpx.
57
58
59 -n number|-number Limits the number of entries displayed to that
60 specified by number. These options are identi‐
61 cal; the -number option is provided as a tran‐
62 sition tool only and is removed in future
63 releases.
64
65
67 Date and time format is based on locale specified by the LC_ALL,
68 LC_TIME, or LANG environments, in that order of priority.
69
71 /var/adm/wtmpx accounting file
72
73
75 See attributes(5) for descriptions of the following attributes:
76
77
78
79
80 ┌─────────────────────────────┬─────────────────────────────┐
81 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
82 ├─────────────────────────────┼─────────────────────────────┤
83 │Availability │SUNWesu │
84 └─────────────────────────────┴─────────────────────────────┘
85
87 utmpx(4), attributes(5)
88
89
90
91SunOS 5.11 24 Jul 2004 last(1)