1 .\" Copyright (C) 1998-2004 Miquel van Smoorenburg.
3 .\" This program is free software; you can redistribute it and/or modify
4 .\" it under the terms of the GNU General Public License as published by
5 .\" the Free Software Foundation; either version 2 of the License, or
6 .\" (at your option) any later version.
8 .\" This program is distributed in the hope that it will be useful,
9 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
10 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 .\" GNU General Public License for more details.
13 .\" You should have received a copy of the GNU General Public License
14 .\" along with this program; if not, write to the Free Software
15 .\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 .TH "LAST, LASTB" "1" "October 2013" "util-linux" "User Commands"
19 last, lastb \- show a listing of last logged in users
23 .RI [ username "...] [" tty ...]
27 .RI [ username "...] [" tty ...]
30 searches back through the
32 file (or the file designated by the
34 option) and displays a list of all users logged in (and out) since that
35 file was created. One or more
36 .IR usernames " and/or " ttys
37 can be given, in which case
39 will show only the entries matching those arguments. Names of
41 can be abbreviated, thus
46 When catching a \s-2SIGINT\s0 signal (generated by the interrupt key, usually
47 control-C) or a \s-2SIGQUIT\s0 signal,
49 will show how far it has searched through the file; in the case of the
56 logs in each time the system is rebooted. Thus
58 will show a log of all the reboots since the log file was created.
63 except that by default it shows a log of the
65 file, which contains all the bad login attempts.
68 .BR \-a , " \-\-hostlast"
69 Display the hostname in the last column. Useful in combination with the
74 For non-local logins, Linux stores not only the host name of the remote
75 host, but its IP number as well. This option translates the IP number
78 .BR \-f , " \-\-file " \fIfile\fR
81 to use a specific \fIfile\fR instead of
85 option can be given multiple times, and all of the specified files will be
88 .BR \-F , " \-\-fulltimes"
89 Print full login and logout times and dates.
94 but displays the host's IP number instead of the name.
98 .BR \-n , " -\-limit " \fInumber\fR
101 how many lines to show.
103 .BR \-p , " \-\-present " \fItime\fR
104 Display the users who were present at the specified time. This is
105 like using the options
106 .BR \-\-since " and " \-\-until
107 together with the same \fItime\fR.
109 .BR \-R , " \-\-nohostname"
110 Suppresses the display of the hostname field.
112 .BR \-s , " \-\-since " \fItime\fR
113 Display the state of logins since the specified
115 This is useful, e.g., to easily determine who was logged in at a
116 particular time. The option is often combined with
119 .BR \-t , " \-\-until " \fItime\fR
120 Display the state of logins until the specified
123 .BI \-\-time\-format " format"
124 Define the output timestamp
134 variant will not print any timestamps at all,
142 variant will display the timestamp in ISO-8601 format. The ISO format
143 contains timezone information, making it preferable when printouts are
144 investigated outside of the system.
146 .BR \-w , " \-\-fullnames"
147 Display full user names and domain names in the output.
149 .BR \-x , " \-\-system"
150 Display the system shutdown entries and run level changes.
152 The options that take the
154 argument understand the following formats:
159 YYYY-MM-DD hh:mm (seconds will be set to 00)
160 YYYY-MM-DD (time will be set to 00:00:00)
161 hh:mm:ss (date will be set to today)
162 hh:mm (date will be set to today, seconds to 00)
164 yesterday (time is set to 00:00:00)
165 today (time is set to 00:00:00)
166 tomorrow (time is set to 00:00:00)
175 might not be found. The system only logs information in these files if
176 they are present. This is a local configuration issue. If you want the
177 files to be used, they can be created with a simple
179 command (for example,
180 .IR "touch /var/log/wtmp" ).
186 .MT miquels@cistron.nl
187 Miquel van Smoorenburg
190 The last command is part of the util-linux package and is available from
191 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/