]> granicus.if.org Git - shadow/blob - man/lastlog.8.xml
* man/chpasswd.8.xml, man/grpck.8.xml, man/newgrp.1.xml,
[shadow] / man / lastlog.8.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3    Copyright (c) 1992       , Julianne Frances Haugh
4    Copyright (c) 1992       , Phillip Street
5    Copyright (c) 2007 - 2009, Nicolas François
6    All rights reserved.
7   
8    Redistribution and use in source and binary forms, with or without
9    modification, are permitted provided that the following conditions
10    are met:
11    1. Redistributions of source code must retain the above copyright
12       notice, this list of conditions and the following disclaimer.
13    2. Redistributions in binary form must reproduce the above copyright
14       notice, this list of conditions and the following disclaimer in the
15       documentation and/or other materials provided with the distribution.
16    3. The name of the copyright holders or contributors may not be used to
17       endorse or promote products derived from this software without
18       specific prior written permission.
19   
20    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23    PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT
24    HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30    OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 -->
32 <refentry id='lastlog.8'>
33   <!-- $Id$ -->
34   <refmeta>
35     <refentrytitle>lastlog</refentrytitle>
36     <manvolnum>8</manvolnum>
37     <refmiscinfo class="sectdesc">System Management Commands</refmiscinfo>
38   </refmeta>
39   <refnamediv id='name'>
40     <refname>lastlog</refname>
41     <refpurpose>reports the most recent login of all users or of a given user</refpurpose>
42   </refnamediv>
43   <!-- body begins here -->
44   <refsynopsisdiv id='synopsis'>
45     <cmdsynopsis>
46       <command>lastlog</command>
47       <arg choice='opt'>
48         <replaceable>options</replaceable>
49       </arg>
50     </cmdsynopsis>
51   </refsynopsisdiv>
52
53   <refsect1 id='description'>
54     <title>DESCRIPTION</title>
55     <para>
56       <command>lastlog</command> formats and prints the contents of the last
57       login log <filename>/var/log/lastlog</filename> file. The
58       <emphasis>login-name</emphasis>, <emphasis>port</emphasis>, and
59       <emphasis>last login time</emphasis> will be printed.  The default (no
60       flags) causes lastlog entries to be printed, sorted by their order in
61       <filename>/etc/passwd</filename>.
62     </para>
63   </refsect1>
64
65   <refsect1 id='options'>
66     <title>OPTIONS</title>
67     <para>
68       The options which apply to the <command>lastlog</command> command are:
69     </para>
70     <variablelist remap='IP'>
71       <varlistentry>
72         <term>
73           <option>-b</option>, <option>--before</option> <replaceable>DAYS</replaceable>
74         </term>
75         <listitem>
76           <para>
77             Print only lastlog records older than <emphasis remap='I'>DAYS</emphasis>.
78           </para>
79         </listitem>
80       </varlistentry>
81       <varlistentry>
82         <term>
83           <option>-h</option>, <option>--help</option>
84         </term>
85         <listitem>
86           <para>Display help message and exit.</para>
87         </listitem>
88       </varlistentry>
89       <varlistentry>
90         <term>
91           <option>-t</option>, <option>--time</option>
92           <replaceable>DAYS</replaceable>
93         </term>
94         <listitem>
95           <para>
96             Print the lastlog records more recent than
97             <emphasis remap='I'>DAYS</emphasis>.
98           </para>
99         </listitem>
100       </varlistentry>
101       <varlistentry>
102         <term>
103           <option>-u</option>, <option>--user</option>
104           <replaceable>LOGIN</replaceable>|<replaceable>RANGE</replaceable>
105         </term>
106         <listitem>
107           <para>
108             Print the lastlog record of the specified user(s).
109           </para>
110           <para>
111             The users can be specified by a login name, a numerical user ID,
112             or a <replaceable>RANGE</replaceable> of users. This
113             <replaceable>RANGE</replaceable> of users can be specified with a
114             min and max values (<replaceable>UID_MIN-UID_MAX</replaceable>), a
115             max value (<replaceable>-UID_MAX</replaceable>), or a min value
116             (<replaceable>UID_MIN-</replaceable>).
117           </para>
118         </listitem>
119       </varlistentry>
120     </variablelist>
121
122     <para>
123       If the user has never logged in the message <emphasis>** Never logged
124       in**</emphasis> will be displayed instead of the port and time.
125     </para>
126
127     <para>
128       Only the entries for the current users of the system will be
129       displayed.  Other entries may exist for users that were deleted
130       previously.
131     </para>
132   </refsect1>
133
134   <refsect1 id='note'>
135     <title>NOTE</title>
136     <para>
137       The <filename>lastlog</filename> file is a database which contains info
138       on the last login of each user. You should not rotate it. It is a sparse
139       file, so its size on the disk is usually much smaller than the one shown
140       by "<command>ls -l</command>" (which can indicate a really big file if
141       you have in <filename>passwd</filename> users with a high UID). You can
142       display its real size with "<command>ls -s</command>".
143     </para>
144   </refsect1>
145
146   <refsect1 id='files'>
147     <title>FILES</title>
148     <variablelist>
149       <varlistentry>
150         <term><filename>/var/log/lastlog</filename></term>
151         <listitem>
152           <para>Database times of previous user logins.</para>
153         </listitem>
154       </varlistentry>
155     </variablelist>
156   </refsect1>
157
158   <refsect1 id='caveats'>
159     <title>CAVEATS</title>
160     <para>
161       Large gaps in UID numbers will cause the lastlog program to run
162       longer with no output to the screen (i.e. if in lastlog database there
163       is no entries for users with UID between 170 and 800 lastlog will appear
164       to hang as it processes entries with UIDs 171-799).
165     </para>
166   </refsect1>
167 </refentry>