logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

wtmpdb - display login, logout and reboot information

Author

       wtmpdb was written by Thorsten Kukuk <kukuk@suse.com>.

wtmpdb 0.73.0                                      05/04/2025                                          WTMPDB(8)

Commands

       The following commands are understood:

       last [option...] [username...] [tty...]
           wtmpdblast goes through the /var/lib/wtmpdb/wtmp.db database (or the database designated by the -f
           option) and displays a list of of all users logged in and logged out. The output can be restricted to
           different patterns via various options. If one or more usernames and/or ttys are given wtmpdblast
           will only show the entries matching those arguments.

           The login and logout times of the special user reboot are the boot and shutdown times of the system.

           -a,--hostlast
               Display hostnames in the last column.

           -d,--dns
               Translate IP addresses into a hostname.

           -f,--fileFILE
               Use FILE as wtmpdb database.

           -F,--fulltimes
               Display full times and dates.

           -i,--ip
               Translate hostnames to IP addresses.

           -n,--limitN, -N
               Display only the first N entries.

           -p,--presentTIME
               Display who was present at TIME.

           -R,--nohostname
               Don't display any hostname or IP address.

           -S,--service
               Display PAM service used to login.

           -s,--sinceTIME
               Print only records more recent than TIME.

           -t,--untilTIME
               Print only records until TIME.

           -w,--fullnames
               Display full IP addresses and user and domain names.

           -x,--system
               Display system shutdown entries.

           --time-formatFORMAT
               Display timestamps in the specified FORMAT. The format can be notime, short, full, or iso.
               notime will not display times at all, short is the default option, full will display the full
               times and dates, and iso will display times in ISO-8601 format.

           TIME must be in the format "YYYYMMDDHHMMSS", "YYYY-MM-DDHH:MM:SS", "YYYY-MM-DDHH:MM", "YYYY-MM-DD",
           "HH:MM:SS", "HH:MM", "now", "today", "yesterday" or "tomorrow" (time will be set to 00:00:00 if not
           specified; the date to today's).

       boot [option...]
           wtmpdbboot writes system boot times to the /var/lib/wtmpdb/wtmp.db database.

           -f,--fileFILE
               Use FILE as wtmpdb database.

           -q,--quiet
               Don't print informative messages.

       shutdown [option...]
           wtmpdbshutdown writes system shutdown requests to the /var/lib/wtmpdb/wtmp.db database.

           -f,--fileFILE
               Use FILE as wtmpdb database.

       rotate [option...]
           wtmpdbrotate exports old log entries to the /var/lib/wtmpdb/wtmp_yyyymmmdd.db database and removes
           these entries from the original one.

           -f,--fileFILE
               Use FILE as wtmpdb database. The exported DB file will be on the same location.

           -d,--daysDAYS
               Entries will be exported which are older than DAYS days. Default is 60 days.

       import [option...] file...
           wtmpdbimport imports legacy wtmp log files to the /var/lib/wtmpdb/wtmp.db database.

           -f,--fileFILE
               Use FILE as wtmpdb database.

       global options

           -h,--help
               Display help message and exit.

           -v,--version
               Print version number and exit.

Description

wtmpdb displays the content of the wtmp login and boot times database and provides sub-commands for
       system scripts to create boot and shutdown entries and otherwise manipulate the wtmp database.

       This command is year 2038-safe and uses sqlite3 to store the information.

Files

       /var/lib/wtmpdb/wtmp.db
           Wtmpdb logging database file

Name

       wtmpdb - display login, logout and reboot information

See Also

pam_wtmpdb(8),

Synopsis

wtmpdb COMMAND [option...]

See Also