Release 6
[unix-history] / usr / src / usr.bin / last / last.1
CommitLineData
d9d7a9f0 1.\" Copyright (c) 1980, 1990 The Regents of the University of California.
7e45e5fb 2.\" All rights reserved.
e20828d9 3.\"
a9b9c8f8 4.\" %sccs.include.redist.roff%
7e45e5fb 5.\"
a9b9c8f8 6.\" @(#)last.1 6.8 (Berkeley) %G%
e20828d9 7.\"
d9d7a9f0
CL
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
a9b9c8f8 16.Op Fl Ns Ar n
d9d7a9f0
CL
17.Op Fl f Ar file
18.Op Fl h Ar host
19.Op Fl t Ar tty
20.Op user ...
21.Sh DESCRIPTION
22.Nm Last
23will list the sessions of specified
24.Ar users ,
25.Ar ttys ,
26and
27.Ar hosts ,
28in reverse time order. Each line of output contains
f619d373
KB
29the user name, the tty from which the session was conducted, any
30hostname, the start and stop times for the session, and the duration
31of the session. If the session is still continuing or was cut short by
d9d7a9f0
CL
32a crash or shutdown,
33.Nm last
34will so indicate.
35.Pp
a9b9c8f8
CL
36.Bl -tag -width indent-two
37.It Fl f Ar file
d9d7a9f0
CL
38.Nm Last
39reads the file
5325ced3
CL
40.Ar file
41instead of the default,
d9d7a9f0 42.Pa /var/log/wtmp .
a9b9c8f8
CL
43.It Fl Ar n
44Limits the report to
45.Ar n
d9d7a9f0 46lines.
a9b9c8f8 47.It Fl t Ar tty
d9d7a9f0
CL
48Specify the
49.Ar tty .
a9b9c8f8
CL
50Tty names may be given fully or abbreviated, for example,
51.Dq Li "last -t 03"
52is
53equivalent to
54.Dq Li "last -t tty03" .
55.It Fl h Ar host
d9d7a9f0
CL
56.Ar Host
57names may be names or internet numbers.
a9b9c8f8 58.El
d9d7a9f0
CL
59.Pp
60If
b6ef7299 61multiple arguments are given, the information which applies to any of the
a9b9c8f8
CL
62arguments is printed, e.g.,
63.Dq Li "last root -t console"
64would list all of
65.Dq Li root Ns 's
66sessions as well as all sessions on the console terminal. If no
d9d7a9f0
CL
67users, hostnames or terminals are specified,
68.Nm last
69prints a record of
b6ef7299 70all logins and logouts.
d9d7a9f0
CL
71.Pp
72The pseudo-user
73.Ar reboot
74logs in at reboots of the system, thus
a9b9c8f8
CL
75.Dq Li last reboot
76will give an indication of mean time between reboot.
d9d7a9f0
CL
77.Pp
78If
79.Nm last
80is interrupted, it indicates to what date the search has
5325ced3
CL
81progressed. If interrupted with a quit signal
82.Nm last
d9d7a9f0 83indicates how
f619d373 84far the search has progressed and then continues.
d9d7a9f0 85.Sh FILES
a9b9c8f8
CL
86.Bl -tag -width /var/log/wtmp -compact
87.It Pa /var/log/wtmp
d9d7a9f0 88login data base
a9b9c8f8 89.El
d9d7a9f0
CL
90.Sh SEE ALSO
91.Xr lastcomm 1 ,
92.Xr utmp 5 ,
93.Xr ac 8
94.Sh HISTORY
95.Nm Last
a9b9c8f8
CL
96appeared in
97.Bx 3.0 .