TUPTIME(1)

πŸ’– TUPTIME πŸ’– (section 1 of the General Commands Manual, bestie)

okay so. imagine you wanna know how long your lil computer has been alive, like actually alive, across every reboot it's ever done. that's tuptime. she's a command-line girlie in the General Commands Manual, and she keeps receipts. receipts that survive reboots. iconic behavior honestly 🫢


🌸 NAME 🌸

tuptime β€” reports historical and statistical system uptime, preserved across reboots. Total uptime. periodt.

✨ SYNOPSIS ✨

tuptime [-h] [-A STARTUP] [-b] [-c] [-d DATETIME_FMT] [-e DECIMALS] [-E
STARTUP] [-f FILE] [-g] [-i] [-k] [-l] [-n] [-o TYPE] [-p] [-q] [-r]
[-s] [-S STARTUP] [-t] [--tat TIMESTAMP] [--tsince TIMESTAMP] [--tuntil
TIMESTAMP] [-U STARTUP] [-v] [-V]

πŸ’… DESCRIPTION πŸ’…

okay so here's the vibe: tuptime reports historical and statistical system uptime, and β€” this is the important part β€” it preserves that info across reboots. she does not forget. she never forgets. πŸ’€

and like, she can do all of this:

  • count system startups
  • register first boot time (since installation time)
  • count graceful and accidental shutdowns
  • uptime and downtime percentage since first boot time
  • accumulated system uptime (running and sleeping), downtime, and total
  • register used kernels and boot IDs
  • report current uptime
  • print a formatted table or list with the system history
  • narrow reports since, until, or at a given startup or timestamp
  • output in csv format

no cap, that's the whole portfolio. πŸŽ€


🌈 OPTIONS 🌈

πŸ¦‹ ARGUMENTS πŸ¦‹

  • -h, --help β€” show this help message and exit
  • -A, --at STARTUP β€” limit to this startup number
  • -b, --bootid β€” show boot identifier
  • -c, --csv β€” output in csv format
  • -d, --date DATETIME_FMT β€” datetime/timestamp format output
  • -e, --dec DECIMALS β€” number of decimals in percentages
  • -E, --exclude STARTUP β€” startup numbers to exclude, comma separated, and you can do target ranges with a dash (e.g. '2,10-20,50')
  • -f, --filedb FILE β€” database file (/var/lib/tuptime/tuptime.db)
  • -g, --graceful β€” register a graceful shutdown
  • -i, --invert β€” startup number in reverse count (for -t, -l, --tat) | switch between longest/shortest on default output
  • -k, --kernel β€” show kernel version
  • -l, --list β€” enumerate system life as list. mutually exclusive with -t and --tat
  • -n, --noup β€” avoid update values into DB
  • -o, --order TYPE β€” order enumerate by [u|r|s|e|d|k]. only works with -t or -l. (u = uptime | r = runtime | s = sleep time | e = end status | d = downtime | k = kernel)
  • -p, --power β€” show power states run + sleep. cannot be used in combination with --tsince, --tuntil or --tat
  • -q, --quiet β€” update values into DB without output
  • -r, --reverse β€” reverse order in listings. only works with -t or -l
  • -s, --seconds β€” output time in seconds and epoch
  • -S, --since STARTUP β€” limit from this startup number
  • -t, --table β€” enumerate system life as table. mutually exclusive with -l and --tat
  • --tat TIMESTAMP β€” system status at epoch timestamp. mutually exclusive with -l and -t
  • --tsince TIMESTAMP β€” limit from this epoch timestamp
  • --tuntil TIMESTAMP β€” limit until this epoch timestamp
  • -U, --until STARTUP β€” limit up until this startup number
  • -v, --verbose β€” verbose output
  • -V, --version β€” show version

🧚 ENVIRONMENT 🧚

  • TUPTIME_DBF β€” set an alternative database file path. the argument -f, --filedb takes precedence over this.
bestie note: if you set both, the flag wins. she said what she said. πŸ’…

πŸ‘‘ DEFAULT OUTPUT πŸ‘‘

when you just run her with nothing, this is what you get:

System startups

total number of system startups since first timestamp available.

System shutdowns

total number of shutdowns done correctly or incorrectly.

System life

time counter since first startup timestamp available.

System uptime / System downtime

percentage of time and time counter.

Longest uptime / Longest downtime

time counter and date with the longest/shortest uptime/downtime register.

Average uptime / Average downtime

average time counter.

Current uptime

actual time counter and datetime since registered boot timestamp.


πŸ”₯ EXAMPLES πŸ”₯

tuptime

default output.

tuptime -t

enumerate system life as table. mutually exclusive with -l and --tat.

tuptime -l

enumerate system life as list. mutually exclusive with -t and --tat.

tuptime -k

add kernel information to the output.

tuptime --csv

report in csv format.

tuptime -s

change default human readable datetime/timestamp style and print times in seconds and datetimes in epoch.

tuptime -d '%H:%M:%S %m-%d-%Y'

change the datetime/timestamp format. by default the output use the configured system locales.

tuptime --tsince -31557600

report since one year ago.


πŸ“ FILES πŸ“

file paths may vary depending on the operating system and distribution. (just so you know, so you don't come for me 😭)

  • /var/lib/tuptime/tuptime.db β€” default database file.
  • /etc/cron.d/tuptime β€” scheduled cron file.
  • /etc/init.d/tuptime β€” init file.
  • /usr/lib/systemd/system/tuptime.service β€” systemd service unit file. register time values into database.
  • /usr/bin/tuptime β€” main and only executable file.
  • /usr/share/doc/tuptime/ β€” directory with multiple documentation files.
  • /usr/lib/systemd/system/tuptime-sync.timer β€” systemd .timer unit for use instead of cron. only executes tuptime-sync.service.
  • /usr/lib/systemd/system/tuptime-sync.service β€” systemd .service unit required by tuptime-sync.timer. updates time values into database.
  • /usr/lib/sysusers.d/tuptime.conf β€” systemd sysusers configuration file for creating the _tuptime user.
  • /usr/share/man/man1/tuptime.1 β€” manual page.

πŸ’œ SEE ALSO πŸ’œ


⭐ REQUIREMENTS ⭐

  • Python 3.x

πŸŽ€ AUTHOR πŸŽ€

Ricardo Fraile <r@rfmoz.eu>

Copyright (C) 2026 by Ricardo F. All Rights Reserved.

This product is distributed in the hope that it will be useful, but WITHOUT any warranty; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


and that's the whole page, bestie ✨ this was version 5.2.6, dated Apr 2026, and yes she's filed under TUPTIME(1) in the General Commands Manual. go forth and know exactly how long your machine has been awake. she's been waiting to tell you. πŸ’–

πŸ“¦ where this page comes from