xref: /original-bsd/usr.bin/last/last.1 (revision f1a1f5ae)
1.\" Copyright (c) 1980, 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)last.1	6.5 (Berkeley) 06/24/90
7.\"
8.Dd
9.Dt LAST 1
10.Os BSD 4
11.Sh NAME
12.Nm last
13.Nd indicate last logins of users and ttys
14.Sh SYNOPSIS
15.Nm last
16.Oo
17.Op Fl Ar \&#
18.Oo
19.Op Fl f Ar file
20.Op Fl h Ar host
21.Op Fl t Ar tty
22.Op user ...
23.Sh DESCRIPTION
24.Nm Last
25will list the sessions of specified
26.Ar users ,
27.Ar ttys ,
28and
29.Ar hosts ,
30in reverse time order.  Each line of output contains
31the user name, the tty from which the session was conducted, any
32hostname, the start and stop times for the session, and the duration
33of the session.  If the session is still continuing or was cut short by
34a crash or shutdown,
35.Nm last
36will so indicate.
37.Pp
38.Nm Last
39reads the file
40.Ar file  ,
41or by default,
42.Pa /var/log/wtmp .
43.Tw Ds
44.Tc Fl
45.Ar \&#
46.Cx
47option limits the report to
48.Ar \&#
49lines.
50.Tc Fl t
51.Ws
52.Ar tty
53.Cx
54Specify the
55.Ar tty .
56Tty names may be given fully or abbreviated, e.g., ``last -t 03'' is
57equivalent to ``last -t tty03''.
58.Tc Fl h
59.Ws
60.Ar host
61.Cx
62.Ar Host
63names may be names or internet numbers.
64.Tp
65.Pp
66If
67multiple arguments are given, the information which applies to any of the
68arguments is printed, e.g., ``last root -t console'' would list all of
69``root's'' sessions as well as all sessions on the console terminal. If no
70users, hostnames or terminals are specified,
71.Nm last
72prints a record of
73all logins and logouts.
74.Pp
75The pseudo-user
76.Ar reboot
77logs in at reboots of the system, thus
78``last reboot'' will give an indication of mean time between reboot.
79.Pp
80If
81.Nm last
82is interrupted, it indicates to what date the search has
83progressed.  If interrupted with a quit signal .Nm last
84indicates how
85far the search has progressed and then continues.
86.Sh FILES
87.Dw /var/log/wtmp
88.Di L
89.Dp Pa /var/log/wtmp
90login data base
91.Dp
92.Sh SEE ALSO
93.Xr lastcomm 1 ,
94.Xr utmp 5 ,
95.Xr ac 8
96.Sh HISTORY
97.Nm Last
98appeared in 3 BSD.
99