last(1) last(1)
NAME
last - indicate last user or terminal login
SYNOPSIS
last [-[n] number] [-f filename] [name ...]
DESCRIPTION
last can be used to list the times when users have logged in and out.
OPTIONS
No option specified:
last lists all the login and logout times recorded in
/var/adm/wtmpx and issues a message of the form "wtmpx begins
date", indicating the date of the oldest entry.
[n] number
Limit the number of login and logout times displayed to number.
-number
-n number
Limit the number of login and logout times displayed to number,
but without printing the "wtmpx begins date" message.
-f filename
Specifies filename as the accounting file from which login and
logout times are read. The default accounting file is
/var/adm/wtmpx.
name One or more login names and/or terminal numbers (tty???).
Mode of operation
The file /var/adm/wtmpx maintains a record of all login and logout
times. last retrieves all the information about a user and the associ-
ated terminals from this file.
The arguments to last specify the login names or terminals for which
information is to be retrieved. The names of terminals must be given
in full.
last displays the following information:
- the login name
- the terminal
- where appropriate, the name of the host from which the user logged
in
- the login and logout times
Page 1 Reliant UNIX 5.44 Printed 11/98
last(1) last(1)
By default, last displays a record of all logins and logouts in
reverse order. If specific users or terminals are supplied as argu-
ments, only the information for the selected users or terminals will
be output. If multiple arguments are given, the information which
applies to each individual argument is printed.
last also indicates if the session is still continuing or was cut
short by a reboot. The pseudo user reboot logs in each time the system
is rebooted.
If last is interrupted, it prints a message on the standard output to
indicate how far the search had progressed until the time of the
interrupt. If last is interrupted with SIGQUIT (CTRL-\), however, it
will write the same message to standard output and then continue the
search.
LOCALE
The LCMESSAGES environment variable governs the language in which
message texts are displayed. If LCMESSAGES is undefined or is defined
as the null string, it defaults to the value of LANG. If LANG is like-
wise undefined or null, the system acts as if it were not internation-
alized.
The LCALL environment variable governs the entire locale. LCALL
takes precedence over all the other environment variables which affect
internationalization.
EXAMPLES
User Jon wishes to determine the last three times at which he logged
in at terminal tty006. He also wishes to know if other users have been
working at the same terminal.
$ last -3 Jon tty006
Jon tty006 Fri Aug 3 13:37 - 15:53 (02:15)
Jon tty006 Thu Aug 2 10:25 - 12:56 (02:31)
Jon tty006 Wed Aug 1 09:54 - 11:47 (01:53)
FILES
/var/adm/wtmp
/var/adm/wtmpx
The file /var/adm/wtmp[x] contains information about users and
accounting information. The login and logout times are recorded
in this file.
SEE ALSO
utmp(4).
Page 2 Reliant UNIX 5.44 Printed 11/98