Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

lastlogin(8) [netbsd man page]

LASTLOGIN(8)						    BSD System Manager's Manual 					      LASTLOGIN(8)

NAME
lastlogin -- indicate last login time of users SYNOPSIS
lastlogin [-nrt] [-f filename] [-H hostsize] [-L linesize] [-N namesize] [user ...] DESCRIPTION
lastlogin will list the last login session of specified users, or for all users by default. Each line of output contains the user name, the tty from which the session was conducted, any hostname, and the start time for the session. If multiple users are given, the session information for each user is printed in the order given on the command line. Otherwise, information for all users is printed, sorted by uid. lastlogin differs from last(1) in that it only prints information regarding the very last login session. The last login database is never turned over or deleted in standard usage. The following options are available: -f filename Process input from filename. If the file ends with an ``x'', then it is assumed that it is a lastlogx(5) file, else it is assumed to be a lastlog(5) file. -H hostlen Set the field width for host output to hostlen characters. -L linelen Set the field width for line output to linelen characters. -N namelen Set the field width for name output to namelen characters. -n Attempt to print numeric host addresses. This option is only supported with lastlogx(5) format files. -r Reverse the order of the sort. -t Sort by last login time (most recent first.) FILES
/var/log/lastlogx default last login database /var/log/lastlog compatibility last login database EXAMPLES
lastlogin looks by default to the /var/log/lastlogx database, where some old programs that are not utmpx(5) aware might only write to /var/log/lastlog. To look at the old database one can use: lastlogin -f /var/log/lastlog SEE ALSO
last(1), lastlog(5), lastlogx(5), ac(8) AUTHORS
John M. Vinopal wrote this program in January 1996 and contributed it to the NetBSD project. BSD
March 4, 2005 BSD

Check Out this Related Man Page

LASTLOG(8)						    System Management Commands							LASTLOG(8)

NAME
lastlog - reports the most recent login of all users or of a given user SYNOPSIS
lastlog [options] DESCRIPTION
lastlog formats and prints the contents of the last login log /var/log/lastlog file. The login-name, port, and last login time will be printed. The default (no flags) causes lastlog entries to be printed, sorted by their order in /etc/passwd. OPTIONS
The options which apply to the lastlog command are: -b, --before DAYS Print only lastlog records older than DAYS. -h, --help Display help message and exit. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. -t, --time DAYS Print the lastlog records more recent than DAYS. -u, --user LOGIN|RANGE Print the lastlog record of the specified user(s). The users can be specified by a login name, a numerical user ID, or a RANGE of users. This RANGE of users can be specified with a min and max values (UID_MIN-UID_MAX), a max value (-UID_MAX), or a min value (UID_MIN-). If the user has never logged in the message ** Never logged in** will be displayed instead of the port and time. Only the entries for the current users of the system will be displayed. Other entries may exist for users that were deleted previously. NOTE
The lastlog 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 usually much smaller than the one shown by "ls -l" (which can indicate a really big file if you have in passwd users with a high UID). You can display its real size with "ls -s". FILES
/var/log/lastlog Database times of previous user logins. CAVEATS
Large gaps in UID numbers will cause the lastlog program to run 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). shadow-utils 4.1.5.1 05/25/2012 LASTLOG(8)
Man Page