1LAST,LASTB(1)         Linux System Administrator's Manual        LAST,LASTB(1)
2
3
4

NAME

6       last, lastb - show listing of last logged in users
7

SYNOPSIS

9       last  [-R] [-num] [ -n num ] [-adFiowx] [ -f file ] [ -t YYYYMMDDHHMMSS
10       ] [name...]  [tty...]
11       lastb [-R] [-num] [ -n num ] [ -f file ] [-adFiowx] [name...]  [tty...]
12

DESCRIPTION

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

OPTIONS

34       -f file
35              Tells last to use a specific file instead of /var/log/wtmp.
36
37       -num   This is a count telling last how many lines to show.
38
39       -n num The same.
40
41       -t YYYYMMDDHHMMSS
42              Display  the  state of logins as of the specified time.  This is
43              useful, e.g., to determine easily who was logged in at a partic‐
44              ular  time  --  specify  that  time  with -t and look for "still
45              logged in".
46
47       -f file
48              Specifies a file to search other than /var/log/wtmp.
49
50       -R     Suppresses the display of the hostname field.
51
52       -a     Display the hostname in the last column. Useful  in  combination
53              with the next flag.
54
55       -d     For non-local logins, Linux stores not only the host name of the
56              remote host but its IP number as well.  This  option  translates
57              the IP number back into a hostname.
58
59       -F     Print full login and logout times and dates.
60
61       -i     This  option is like -d in that it displays the IP number of the
62              remote host, but it displays the IP number  in  numbers-and-dots
63              notation.
64
65       -o     Read  an  old-type  wtmp  file  (written by linux-libc5 applica‐
66              tions).
67
68       -w     Display full user and domain names in the output.
69
70       -x     Display the system shutdown entries and run level changes.
71

NOTES

73       The files wtmp and btmp might not be found. The system only logs infor‐
74       mation  in  these files if they are present. This is a local configura‐
75       tion issue. If you want the files to be used, they can be created  with
76       a simple touch(1) command (for example, touch /var/log/wtmp).
77

FILES

79       /var/log/wtmp
80       /var/log/btmp
81

AUTHOR

83       Miquel van Smoorenburg, miquels@cistron.nl
84

SEE ALSO

86       shutdown(8), login(1), init(8)
87
88
89
90                                 Jul 31, 2004                    LAST,LASTB(1)
Impressum