---
name: "lastlogin"
section: "8"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/lastlogin"
---

# lastlogin(8)

indicate last login time of users

## NAME

**lastlogin** – indicate last login time of users

## SYNOPSIS

**lastlogin** \[**--libxo**\] \[**-f** *file*\] \[**-rt**\] \[*user* *...*\]

## DESCRIPTION

The **lastlogin** utility will list the last login session of each specified *user*, 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 more than one *user* is given, the session information for each user is printed in the order given on the command line. Otherwise, information for all users is printed. By default, the entries are sorted by user name.

The **lastlogin** utility differs from [last(1)](/last/1.md) 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:

- **--libxo**

  Generate output via [libxo(3)](/libxo/3.md) in a selection of different human and machine readable formats. See [xo\_options(7)](/xo_options/7.md) for details on command line arguments.

- **-f** *file*

  Open last login database *file* instead of the system-wide database.

- **-r**

  Print the entries in reverse sorted order.

- **-t**

  Sort the elements by last login time, instead of user name.

## FILES

- */var/log/utx.lastlogin*

  last login database

## SEE ALSO

[last(1)](/last/1.md), [getutxent(3)](/getutxent/3.md), [libxo(3)](/libxo/3.md), [xo\_options(7)](/xo_options/7.md), [ac(8)](/ac/8.md)

## AUTHORS

John M. Vinopal wrote this program in January 1996 and contributed it to the NetBSD project. Philip Paeps added [libxo(3)](/libxo/3.md) support in August 2018.
