2007-10-07 17:17:33 +05:30
. \" Title: lastlog
. \" Author:
. \" Generator: DocBook XSL Stylesheets v1.70.1 <http://docbook.sf.net/>
. \" Date: 06/06/2006
. \" Manual: System Management Commands
. \" Source: System Management Commands
. \"
.TH "LASTLOG" "8" "06/06/2006" "System Management Commands" "System Management Commands"
2007-10-07 17:16:52 +05:30
. \" disable hyphenation
.nh
. \" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
2007-10-07 17:14:44 +05:30
lastlog \- examine lastlog file
2007-10-07 17:16:25 +05:30
.SH "SYNOPSIS"
.HP 8
\fB lastlog\fR [\fI options\fR ]
.SH "DESCRIPTION"
2007-10-07 17:14:51 +05:30
.PP
2007-10-07 17:17:33 +05:30
2007-10-07 17:17:01 +05:30
\fB lastlog\fR
formats and prints the contents of the last login log
\fI /var/log/lastlog\fR
file. The
\fI login\- name\fR ,
\fI port\fR , and
\fI last login time\fR
will be printed. The default (no flags) causes lastlog entries to be printed, sorted by their order in
2007-10-07 17:16:52 +05:30
\fI /etc/passwd\fR .
2007-10-07 17:16:25 +05:30
.SH "OPTIONS"
2007-10-07 17:17:01 +05:30
.PP
The options which apply to the
\fB lastlog\fR
command are:
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:17:01 +05:30
\fB \- b\fR , \fB \- \- before\fR \fI DAYS\fR
Print only lastlog records older than
\fI DAYS\fR .
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:16:25 +05:30
\fB \- h\fR , \fB \- \- help\fR
2007-10-07 17:17:01 +05:30
Display help message and exit.
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:16:25 +05:30
\fB \- t\fR , \fB \- \- time\fR \fI DAYS\fR
2007-10-07 17:17:01 +05:30
Print the lastlog records more recent than
2007-10-07 17:16:52 +05:30
\fI DAYS\fR .
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:16:25 +05:30
\fB \- u\fR , \fB \- \- user\fR \fI LOGIN\fR
2007-10-07 17:17:01 +05:30
Print the lastlog record for user with specified
\fI LOGIN\fR
2007-10-07 17:16:52 +05:30
only.
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:16:52 +05:30
The \fB \- t\fR flag overrides the use of \fB \- u\fR .
2007-10-07 17:14:44 +05:30
.PP
2007-10-07 17:17:01 +05:30
If the user has never logged in the message
\fI ** Never logged in**\fR
2007-10-07 17:16:52 +05:30
will be displayed instead of the port and time.
2007-10-07 17:16:34 +05:30
.SH "NOTE"
.PP
2007-10-07 17:17:01 +05:30
The
\fI lastlog\fR
file is a database which contains info on the last login of each user. You should not rotate it. It is a sparse file, so its size on the disk is much smaller than the one shown by "\fB ls \- l\fR " (which can indicate a really big file if you have a high UID). You can display its real size with "\fB ls \- s\fR ".
2007-10-07 17:16:25 +05:30
.SH "FILES"
2007-10-07 17:17:33 +05:30
.TP 3 n
2007-10-07 17:16:25 +05:30
\fI /var/log/lastlog\fR
2007-10-07 17:17:33 +05:30
Database times of previous user logins.
2007-10-07 17:16:25 +05:30
.SH "CAVEATS"
.PP
2007-10-07 17:17:11 +05:30
Large gaps in UID numbers will cause the lastlog program to run longer with no output to the screen (i.e. if mmdf=800 and last UID=170, program will appear to hang as it processes UID 171\- 799).