Imported upstream version 1.5
[manpages-zh.git] / raw / man1 / last.1
bloba403107f578855e74b287f7f8f301968ebf64f42
1 .\"{{{}}}
2 .\"{{{  Title
3 .TH LAST,LASTB 1 "Jul 29, 1999" "" "Linux System Administrator's Manual"
4 .\"}}}
5 .\"{{{  Name
6 .SH NAME
7 last, lastb \- show listing of last logged in users
8 .\"}}}
9 .\"{{{  Synopsis
10 .SH SYNOPSIS
11 .B last
12 .RB [ \-R ]
13 .RB [ \-\fInum\fP ]
14 .RB "[ \-\fBn\fP \fInum\fP ]"
15 .RB [ \-adiox ]
16 .RB "[ \-\fBf\fP \fIfile\fP ]"
17 .RB "[ \-\fBt\fP \fIYYYYMMDDHHMMSS\fP ]"
18 .RI [ name... ]
19 .RI [ tty... ]
20 .br
21 .B lastb
22 .RB [ \-R ]
23 .RB [ \-\fInum\fP ]
24 .RB "[ \-\fBn\fP \fInum\fP ]"
25 .RB "[ \-\fBf\fP \fIfile\fP ]"
26 .RB "[ \-\fBt\fP \fIYYYYMMDDHHMMSS\fP ]"
27 .RB [ \-adiox ]
28 .RI [ name... ]
29 .RI [ tty... ]
30 .\"}}}
31 .\"{{{  Description
32 .SH DESCRIPTION
33 .B Last
34 searches back through the file \fB/var/log/wtmp\fP (or the file
35 designated by the \fB\-f\fP flag) and displays a list of all
36 users logged in (and out) since that file was created.  Names of users
37 and tty's can be given, in which case \fBlast\fP will show only those entries
38 matching the arguments.  Names of ttys can be abbreviated, thus \fBlast
39 0\fP is the same as \fBlast tty0\fP.  
40 .PP
41 When \fBlast\fP catches a \s-2SIGINT\s0 signal (generated by the interrupt key,
42 usually control-C) or a \s-2SIGQUIT\s0 signal (generated by the quit key, 
43 usually control-\e), \fBlast\fP will show how far it has searched through the 
44 file; in the case of the \s-2SIGINT\s0 signal \fBlast\fP will then terminate.
45 .PP
46 The pseudo user \fBreboot\fP logs in each time the system is rebooted.
47 Thus \fBlast reboot\fP will show a log of all reboots since the log file
48 was created.
49 .PP
50 \fBLastb\fP is the same as \fBlast\fP, except that by default it shows a log
51 of the file \fB/var/log/btmp\fP, which contains all the bad login attempts.
52 .\"}}}
53 .\"{{{  Options
54 .SH OPTIONS
55 .IP \fB\-\fP\fInum\fP
56 This is a count telling \fBlast\fP how many lines to show.
57 .IP "\fB\-n\fP \fInum\fP"
58 The same.
59 .IP "\fB\-t\fP \fIYYYYMMDDHHMMSS\fP"
60 Display the state of logins as of the specified time.  This is
61 useful, e.g., to determine easily who was logged in at a particular
62 time -- specify that time with \fB\-t\fP and look for "still logged
63 in".
64 .IP \fB\-R\fP
65 Suppresses the display of the hostname field.
66 .IP \fB\-a\fP
67 Display the hostname in the last column. Useful in combination
68 with the next flag.
69 .IP \fB\-d\fP
70 For non-local logins, Linux stores not only the host name of the remote
71 host but its IP number as well. This option translates the IP number
72 back into a hostname.
73 .IP \fB\-i\fP
74 This option is like \fB-d\fP in that it displays the IP number of the remote
75 host, but it displays the IP number in numbers-and-dots notation.
76 .IP \fB\-o\fP
77 Read an old-type wtmp file (written by linux-libc5 applications).
78 .IP \fB\-x\fP
79 Display the system shutdown entries and run level changes.
80 .\"}}}
81 .SH NOTES
82 The files \fIwtmp\fP and \fIbtmp\fP might not be found. The system only
83 logs information in these files if they are present. This is a local
84 configuration issue. If you want the files to be used, they can be
85 created with a simple \fBtouch\fP(1) command (for example, 
86 \fItouch /var/log/wtmp\fP).
87 .\"{{{  Files
88 .SH FILES
89 /var/log/wtmp
90 .br
91 /var/log/btmp
92 .\"}}}
93 .\"{{{  Author
94 .SH AUTHOR
95 Miquel van Smoorenburg, miquels@cistron.nl
96 .\"}}}
97 .\"{{{  See also
98 .SH "SEE ALSO"
99 .BR shutdown (8),
100 .BR login (1),
101 .BR init (8)
102 .\"}}}