xref: /original-bsd/usr.bin/last/last.1 (revision 6ab384a1)
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.6 (Berkeley) 07/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.Tw Fl
39.Tc Fl f
40.Ws
41.Ar file
42.Cx
43.Nm Last
44reads the file
45.Ar file
46instead of the default,
47.Pa /var/log/wtmp .
48.Tc Fl
49.Ar \&#
50.Cx
51option limits the report to
52.Ar \&#
53lines.
54.Tc Fl t
55.Ws
56.Ar tty
57.Cx
58Specify the
59.Ar tty .
60Tty names may be given fully or abbreviated, e.g., ``last -t 03'' is
61equivalent to ``last -t tty03''.
62.Tc Fl h
63.Ws
64.Ar host
65.Cx
66.Ar Host
67names may be names or internet numbers.
68.Tp
69.Pp
70If
71multiple arguments are given, the information which applies to any of the
72arguments is printed, e.g., ``last root -t console'' would list all of
73``root's'' sessions as well as all sessions on the console terminal. If no
74users, hostnames or terminals are specified,
75.Nm last
76prints a record of
77all logins and logouts.
78.Pp
79The pseudo-user
80.Ar reboot
81logs in at reboots of the system, thus
82``last reboot'' will give an indication of mean time between reboot.
83.Pp
84If
85.Nm last
86is interrupted, it indicates to what date the search has
87progressed.  If interrupted with a quit signal
88.Nm last
89indicates how
90far the search has progressed and then continues.
91.Sh FILES
92.Dw /var/log/wtmp
93.Di L
94.Dp Pa /var/log/wtmp
95login data base
96.Dp
97.Sh SEE ALSO
98.Xr lastcomm 1 ,
99.Xr utmp 5 ,
100.Xr ac 8
101.Sh HISTORY
102.Nm Last
103appeared in 3 BSD.
104