WTMPDB(8)

๐Ÿ“ฆ
version 0.75.0 ยท 4 versions
, in ubuntu resolute, ubuntu stonking

๐Ÿ’– NAME ๐Ÿ’–

okay bestie, welcome to the wtmpdb(8) page โ€” this is the manual for wtmpdb, and it displays login, logout and reboot information. that's the whole vibe. it's giving system-archaeology but make it cute. ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

wtmpdb COMMAND [option...]

โœจ DESCRIPTION โœจ

so basically wtmpdb does two jobs and it does them both flawlessly, no cap:

  1. it displays the content of the wtmp login and boot times database ๐Ÿ“–
  2. it gives you sub-commands so system scripts can create boot and shutdown entries, and otherwise manipulate the wtmp database ๐Ÿ› ๏ธ

and here's the iconic part: this command is year 2038-safe and it uses sqlite3 to store the information. she's future-proofed, she's built different, we love her for that. ๐Ÿซถ


๐Ÿ‘‘ COMMANDS ๐Ÿ‘‘

these are the commands that are understood:

๐Ÿฆ‹ last [option...] [username...] [tty...]

wtmpdb last goes through the /var/log/wtmp.db database (or the database designated by the -f option) and displays a list of of all users logged in and logged out. yes that typo is in the original, i'm keeping it, character for character, it's part of the lore. ๐Ÿ™ˆ

the output can be restricted to different patterns via various options. and if one or more usernames and/or ttys are given, wtmpdb last will only show the entries matching those arguments. so specific. so focused. main character energy. โญ

ngl the login and logout times of the special user reboot are the boot and shutdown times of the system. yes really. reboot is a user. she contains multitudes. ๐Ÿ’€
  • -a, --hostlast โ€” displays hostnames in the last column.
  • -d, --dns โ€” translates IP addresses into a hostname.
  • -f, --file FILE โ€” use FILE as the wtmpdb database.
  • -F, --fulltimes โ€” displays full times and dates.
  • -i, --ip โ€” translates hostnames to IP addresses.
  • -n, --limit N, -N โ€” displays only the first N entries.
  • -p, --present TIME โ€” displays who was present at TIME.
  • -R, --nohostname โ€” don't display any hostname or IP address.
  • -S, --service โ€” displays PAM service used to login.
  • -s, --since TIME โ€” prints only records more recent than TIME.
  • -t, --until TIME โ€” prints only records until TIME.
  • -w, --fullnames โ€” displays full IP addresses and user and domain names.
  • -x, --system โ€” displays system shutdown entries.
  • --time-format FORMAT โ€” displays 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. periodt. โฐ

TIME must be in the format "YYYYMMDDHHMMSS", "YYYY-MM-DD HH:MM:SS", "YYYY-MM-DD HH: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...]

wtmpdb boot writes system boot times to the /var/log/wtmp.db database. she's logging the moment the machine wakes up. iconic behavior honestly. ๐ŸŒ…

  • -f, --file FILE โ€” use FILE as the wtmpdb database.
  • -q, --quiet โ€” don't print informative messages.

๐Ÿ’œ shutdown [option...]

wtmpdb shutdown writes system shutdown requests to the /var/log/wtmp.db database. goodbye bestie, see you at the next boot. ๐Ÿ˜ญ

  • -f, --file FILE โ€” use FILE as the wtmpdb database.

๐ŸŒˆ rotate [option...]

wtmpdb rotate exports old log entries to the /var/log/wtmp_yyyymmmdd.db database and removes these entries from the original one. it's a glow-up for your logs. old entries get a new home, the original stays fresh. โœจ

  • -f, --file FILE โ€” use FILE as the wtmpdb database. The exported DB file will be on the same location.
  • -d, --days DAYS โ€” entries will be exported which are older than DAYS days. Default is 60 days.

๐Ÿ“ import [option...] file...

wtmpdb import imports legacy wtmp log files to the /var/log/wtmp.db database. bringing the old stuff into the new era. heritage moment. ๐Ÿงš

  • -f, --file FILE โ€” use FILE as the wtmpdb database.

โญ global options โญ

  • -h, --help โ€” display help message and exit.
  • -v, --version โ€” print version number and exit.

๐Ÿ—‚๏ธ FILES ๐Ÿ—‚๏ธ

  • /var/log/wtmp.db โ€” Wtmpdb logging database file
  • /var/lib/wtmpdb/wtmp.db โ€” Symbolic link from the upstream location to the above database file

๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ


๐Ÿ’– AUTHOR ๐Ÿ’–

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


ok that's the whole page bestie, no notes, 10/10, ate and left no crumbs ๐Ÿซถ

that was wtmpdb version 0.75.0, dated 12/02/2025, and it lives in the wtmpdb(8) section of the manual. mwah. ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from