1LAST,LASTB(1) Linux System Administrator's Manual LAST,LASTB(1)
2
3
4
6 last, lastb - show listing of last logged in users
7
9 last [-R] [-num] [ -n num ] [-adiox] [ -f file ] [ -t YYYYMMDDHHMMSS ]
10 [name...] [tty...]
11 lastb [-R] [-num] [ -n num ] [ -f file ] [-adiox] [name...] [tty...]
12
14 Last searches back through the file /var/log/wtmp (or the file desig‐
15 nated by the -f flag) and displays a list of all users logged in (and
16 out) since that file was created. Names of users and tty's can be
17 given, in which case last will show only those entries matching the
18 arguments. Names of ttys can be abbreviated, thus last 0 is the same
19 as last tty0.
20
21 When last catches a SIGINT signal (generated by the interrupt key, usu‐
22 ally control-C) or a SIGQUIT signal (generated by the quit key, usually
23 control-\), last will show how far it has searched through the file; in
24 the case of the SIGINT signal last will then terminate.
25
26 The pseudo user reboot logs in each time the system is rebooted. Thus
27 last reboot will show a log of all reboots since the log file was cre‐
28 ated.
29
30 Lastb is the same as last, except that by default it shows a log of the
31 file /var/log/btmp, which contains all the bad login attempts.
32
34 -num This is a count telling last how many lines to show.
35
36 -n num The same.
37
38 -t YYYYMMDDHHMMSS
39 Display the state of logins as of the specified time. This is
40 useful, e.g., to determine easily who was logged in at a partic‐
41 ular time -- specify that time with -t and look for "still
42 logged in".
43
44 -f file
45 Specifies a file to search other than /var/log/wtmp.
46
47 -R Suppresses the display of the hostname field.
48
49 -a Display the hostname in the last column. Useful in combination
50 with the next flag.
51
52 -d For non-local logins, Linux stores not only the host name of the
53 remote host but its IP number as well. This option translates
54 the IP number back into a hostname.
55
56 -i This option is like -d in that it displays the IP number of the
57 remote host, but it displays the IP number in numbers-and-dots
58 notation.
59
60 -o Read an old-type wtmp file (written by linux-libc5 applica‐
61 tions).
62
63 -x Display the system shutdown entries and run level changes.
64
66 The files wtmp and btmp might not be found. The system only logs infor‐
67 mation in these files if they are present. This is a local configura‐
68 tion issue. If you want the files to be used, they can be created with
69 a simple touch(1) command (for example, touch /var/log/wtmp).
70
72 /var/log/wtmp
73 /var/log/btmp
74
76 Miquel van Smoorenburg, miquels@cistron.nl
77
79 shutdown(8), login(1), init(8)
80
81
82
83 Jul 31, 2004 LAST,LASTB(1)