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