2007-10-07 17:16:16 +05:30
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<refentry id='lastlog.8'>
|
2007-11-11 05:16:11 +05:30
|
|
|
<!-- $Id$ -->
|
2007-10-07 17:16:16 +05:30
|
|
|
<refmeta>
|
|
|
|
<refentrytitle>lastlog</refentrytitle>
|
|
|
|
<manvolnum>8</manvolnum>
|
2007-10-07 17:17:11 +05:30
|
|
|
<refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
|
2007-10-07 17:16:16 +05:30
|
|
|
</refmeta>
|
|
|
|
<refnamediv id='name'>
|
|
|
|
<refname>lastlog</refname>
|
2007-10-07 17:17:45 +05:30
|
|
|
<refpurpose>reports the most recent login of all users or of a given user</refpurpose>
|
2007-10-07 17:16:16 +05:30
|
|
|
</refnamediv>
|
|
|
|
<!-- body begins here -->
|
|
|
|
<refsynopsisdiv id='synopsis'>
|
|
|
|
<cmdsynopsis>
|
2007-10-07 17:17:01 +05:30
|
|
|
<command>lastlog</command>
|
2007-10-07 17:16:16 +05:30
|
|
|
<arg choice='opt'>
|
2007-10-07 17:17:01 +05:30
|
|
|
<replaceable>options</replaceable>
|
2007-10-07 17:16:16 +05:30
|
|
|
</arg>
|
|
|
|
</cmdsynopsis>
|
|
|
|
</refsynopsisdiv>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
2007-10-07 17:16:16 +05:30
|
|
|
<refsect1 id='description'>
|
|
|
|
<title>DESCRIPTION</title>
|
2007-10-07 17:17:01 +05:30
|
|
|
<para>
|
|
|
|
<command>lastlog</command> formats and prints the contents of the last
|
|
|
|
login log <filename>/var/log/lastlog</filename> file. The
|
|
|
|
<emphasis>login-name</emphasis>, <emphasis>port</emphasis>, and
|
|
|
|
<emphasis>last login time</emphasis> will be printed. The default (no
|
|
|
|
flags) causes lastlog entries to be printed, sorted by their order in
|
|
|
|
<filename>/etc/passwd</filename>.
|
2007-10-07 17:16:16 +05:30
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
2007-10-07 17:16:16 +05:30
|
|
|
<refsect1 id='options'>
|
|
|
|
<title>OPTIONS</title>
|
2007-10-07 17:17:01 +05:30
|
|
|
<para>
|
|
|
|
The options which apply to the <command>lastlog</command> command are:
|
|
|
|
</para>
|
|
|
|
<variablelist remap='IP'>
|
2007-10-07 17:16:16 +05:30
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term>
|
|
|
|
<option>-b</option>, <option>--before</option> <replaceable>DAYS</replaceable>
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print only lastlog records older than <emphasis remap='I'>DAYS</emphasis>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:16 +05:30
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term>
|
|
|
|
<option>-h</option>, <option>--help</option>
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<para>Display help message and exit.</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:16 +05:30
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term>
|
|
|
|
<option>-t</option>, <option>--time</option>
|
2007-10-07 17:16:25 +05:30
|
|
|
<replaceable>DAYS</replaceable>
|
2007-10-07 17:17:01 +05:30
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Print the lastlog records more recent than
|
2007-10-07 17:16:25 +05:30
|
|
|
<emphasis remap='I'>DAYS</emphasis>.
|
2007-10-07 17:17:01 +05:30
|
|
|
</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:16 +05:30
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term>
|
|
|
|
<option>-u</option>, <option>--user</option>
|
2007-10-07 17:16:25 +05:30
|
|
|
<replaceable>LOGIN</replaceable>
|
2007-10-07 17:17:01 +05:30
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<para>Print the lastlog record for user with specified
|
2007-10-07 17:16:25 +05:30
|
|
|
<emphasis remap='I'>LOGIN</emphasis> only.
|
2007-10-07 17:17:01 +05:30
|
|
|
</para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:16 +05:30
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
<variablelist remap='TP'>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term>
|
|
|
|
The <option>-t</option> flag overrides the use of <option>-u</option>.
|
|
|
|
</term>
|
|
|
|
<listitem>
|
|
|
|
<para></para>
|
|
|
|
</listitem>
|
2007-10-07 17:16:16 +05:30
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
|
|
|
<para>
|
|
|
|
If the user has never logged in the message <emphasis>** Never logged
|
|
|
|
in**</emphasis> will be displayed instead of the port and time.
|
2007-10-07 17:16:16 +05:30
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
2007-10-07 17:16:34 +05:30
|
|
|
<refsect1 id='note'>
|
|
|
|
<title>NOTE</title>
|
|
|
|
<para>
|
2007-10-07 17:17:01 +05:30
|
|
|
The <filename>lastlog</filename> file is a database which contains info
|
2007-10-07 17:16:34 +05:30
|
|
|
on the last login of each user. You should not rotate it. It is a sparse
|
2007-10-07 17:17:45 +05:30
|
|
|
file, so its size on the disk is usually much smaller than the one shown
|
|
|
|
by "<command>ls -l</command>" (which can indicate a really big file if
|
|
|
|
you have in <filename>passwd</filename> users with a high UID). You can
|
|
|
|
display its real size with "<command>ls -s</command>".
|
2007-10-07 17:16:34 +05:30
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2007-10-07 17:16:16 +05:30
|
|
|
<refsect1 id='files'>
|
|
|
|
<title>FILES</title>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
2007-10-07 17:17:01 +05:30
|
|
|
<term><filename>/var/log/lastlog</filename></term>
|
|
|
|
<listitem>
|
2007-10-07 17:17:33 +05:30
|
|
|
<para>Database times of previous user logins.</para>
|
2007-10-07 17:17:01 +05:30
|
|
|
</listitem>
|
2007-10-07 17:16:16 +05:30
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</refsect1>
|
2007-10-07 17:17:01 +05:30
|
|
|
|
2007-10-07 17:16:16 +05:30
|
|
|
<refsect1 id='caveats'>
|
|
|
|
<title>CAVEATS</title>
|
2007-10-07 17:17:01 +05:30
|
|
|
<para>
|
2007-10-07 17:17:11 +05:30
|
|
|
Large gaps in UID numbers will cause the lastlog program to run
|
2007-10-07 17:17:45 +05:30
|
|
|
longer with no output to the screen (i.e. if in lastlog database there
|
|
|
|
is no entries for users with UID between 170 and 800 lastlog will appear
|
|
|
|
to hang as it processes entries with UIDs 171-799).
|
2007-10-07 17:16:16 +05:30
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|