content
notes
2022-08-13-algae-spotted-on-river-sava.md 2023-05-01-cachebusting-in-hugo.md 2023-05-05-run-9front-in-qemu.md 2023-05-06-git-push-multiple-origins.md 2023-05-07-mount-plan9-over-network.md 2023-05-08-write-iso-usb.md 2023-05-09-catv-weechat-config.md 2023-05-10-plan9-screenshot.md 2023-05-11-fix-plan9-bootloader.md 2023-05-12-install-plan9port-linux.md 2023-05-13-download-youtube-videos.md 2023-05-14-convert-mkv.md 2023-05-15-preview-troff-man-pages.md 2023-05-16-mass-set-permission.md 2023-05-22-non-blocking-shell-exec-csharp.md 2023-05-23-extend-lua-with-custom-c.md 2023-05-23-parse-rss-with-lua.md 2023-05-24-fresh-9front-desktop.md 2023-05-25-dcss-new-player-guide.md 2023-05-25-show-xterm-colors.md 2023-05-25-tmux-sane-defaults.md 2023-05-27-cronjobs-github-with-actions.md 2023-05-27-dcss-on-4k-displays.md 2023-05-27-drawing-pixels-in-plan9.md 2023-05-28-easy-time-took-in-bash.md 2023-05-29-grep-to-less-maintain-colors.md 2023-05-31-extending-dte-editor.md 2023-06-01-ewd-manuscripts-ebook.md 2023-06-04-bulk-make-thumbnails.md 2023-06-21-presentations-with-markdown.md 2023-06-24-making-cgit-look-nicer.md 2023-06-25-alacritty-open-links-with-modifier.md 2023-06-25-development-environments-with-nix.md 2023-06-29-10gui-10-finger-multitouch-user-interface.md 2023-06-29-60s-ibm-computers-commercial.md 2023-07-10-fix-screen-tearing-on-debian-12-xorg-and-i3.md 2023-07-10-online-radio-streaming-with-mpv-from-terminal.md 2023-07-14-set-color-temperature-of-displays-on-i3.md 2023-08-01-make-b-w-svg-charts-with-matplotlib.md 2023-09-18-aws-eb-pyyaml-fix.md 2023-09-25-compile-drawterm-on-fedora-38.md 2023-11-04-using-ffmpeg-to-combine-video-side-by-side.md 2023-11-05-add-lazy-loading-to-jekyll-posts.md 2023-11-07-personal-sane-vim-defaults.md 2024-02-15-extract-lines-from-file.md 2024-02-21-dcss-online-rc-defaults.md 2024-02-23-uninstall-ollama-from-a-linux-box.md 2024-06-17-calling-assembly-functions-from-c.md 2024-06-17-sending-signals-to-c-programs.md 2024-06-19-embedding-resources-into-binary-with-c.md 2024-06-22-write-and-read-structs-to-files-in-c.md 2024-09-19-use-option-key-as-meta-macos-alactritty.md 2025-02-26-male-and-female-body-proportion-reference-images.md 2025-03-17-vim-ale-linters.md 2025-04-11-lua-performance-in-different-environments.md 2025-06-30-xfce-alt-to-win.md 2025-07-19-minimal-desktop-with-cwm-and-conky.md 2026-06-04-nvidia-driver-works-but-the-monitor-stays-black-with-no-signal.md 2026-06-08-list-uptime-history.mdposts
2011-01-13-most-likely-to-succeed-in-year-of-2011.md 2012-03-09-led-technology-not-so-eco.md 2013-10-24-wireless-sensor-networks.md 2015-11-10-software-development-pitfalls.md 2017-03-07-golang-profiling-simplified.md 2017-04-17-what-i-ve-learned-developing-ad-server.md 2017-04-21-profiling-python-web-applications-with-visual-tools.md 2017-08-11-simple-iot-application.md 2018-01-16-using-digitalocean-spaces-object-storage-with-fuse.md 2019-01-03-encoding-binary-data-into-dna-sequence.md 2019-10-14-simplifying-and-reducing-clutter.md 2019-10-19-using-sentiment-analysis-for-clickbait-detection.md 2020-03-22-simple-sse-based-pubsub-server.md 2020-03-27-create-placeholder-images-with-sharp.md 2020-03-29-the-strange-case-of-elasticsearch-allocation-failure.md 2020-03-30-my-love-and-hate-relationship-with-nodejs.md 2020-05-05-remote-work.md 2020-08-15-systemd-disable-wake-onmouse.md 2020-09-06-esp-and-micropython.md 2020-09-08-bind-warning-on-login.md 2020-09-09-digitalocean-sync.md 2021-01-24-replacing-dropbox-with-s3.md 2021-01-25-goaccess.md 2021-06-26-simple-world-clock.md 2021-07-30-from-internet-consumer-to-full-hominum-again.md 2021-08-01-linux-cheatsheet.md 2021-12-03-debian-based-riced-up-distribution-for-developers.md 2021-12-25-running-golang-application-as-pid1.md 2021-12-30-wap-mobile-web-before-the-web.md 2022-06-30-trying-out-helix-editor.md 2022-07-05-what-would-dna-sound-if-synthesized.md 2022-10-06-state-of-web-technologies-in-year-2022.md 2022-10-16-that-sound-that-machine-makes-when-struggling.md 2023-01-26-trying-to-build-a-new-kind-of-terminal-emulator.md 2023-05-16-rekindling-my-love-for-programming.md 2023-05-23-i-was-wrong-about-git-workflows.md 2023-05-31-re-inventing-task-runner-that-i-actually-used-daily.md 2023-07-01-bringing-all-of-my-projects-together-under-one-umbrella.md 2023-07-08-who-knows-what-the-world-will-look-like-tomorrow.md 2023-11-05-elitist-attitudes-are-sapping-the-fun-from-programming.md 2024-02-11-k-mer.md 2024-02-28-converting-valgrind-callgrinds-to-svg-format.md 2024-03-10-the-abysmal-state-of-linux-in-the-year-2024.md 2024-03-10-using-custom-software-with-github-actions-to-deploy-a-site.md 2024-03-14-configuration-and-plugin-hell-and-why-i-dont-use-vim-and-tmux-anymore.md 2025-04-08-embedding-game-assets-within-your-binary.md 2026-01-09-vim.md 2026-01-14-change-default-applications-on-linux.md 2026-01-15-using-address-sanitizer-with-clang.mdstatic
assets
notes
10gui-10-finger-multitouch-user-interface.jpg 10gui-10-finger-multitouch-user-interface.mp4 60s-ibm-computers-commercial.jpg 60s-ibm-computers-commercial.mp4 9front-desktop.png asm64-handout.pdf cwm.png dcss-quickstart.pdf dcss.jpg dcss_manual.pdf embedding-assets.png embedding-binary-data.tar.xz embedding-window.png female-body-proportions.jpg grep-less.png male-body-proportions.jpg plan9-pixels.png plot.svg ps1-prompt.png trigraphs.gif xterm-palette.pngposts
algae-sava
dji-algae-0.jpg dji-algae-1.jpg dji-algae-2.jpg dji-algae-3.jpg dji-algae-4.jpg dji-algae-5.jpgdfd-rice
desktop.png install-00.png install-01.png install-02.png install-03.png install-04.png install-05.png installation.svg layout.png layout.svg script.pngdna-sequence
benchmarks.csv chart-size.py chart-size.svg chart-speed.py chart-speed.svg dna-basics.jpg quote.png sample-binary-file.png sample.pnggodot-dynamic-tile-loading
example1
index.apple-touch-icon.png index.audio.worklet.js index.html index.icon.png index.js index.pck index.png index.wasmiot-application
iot-app-output.png iot-rest-example.png iot-sqlite-db.png kcachegrind.png profiling-viewer.png simple-iot-application-overview.svg simple-iot-application.zip snakeviz.pngprojects
ClassicEnhanced-v1.0.0.tar.gz ClassicEnhanced-v1.0.1.tar.gz TurtleTweaks-v0.1.tar.gz TurtleTweaks-v0.2.tar.gz TurtleTweaks-v0.3.tar.gz TurtleTweaks-v0.4.tar.gz TurtleTweaks-v0.5.1.tar.gz TurtleTweaks-v0.5.tar.gz TurtleTweaks-v0.6.tar.gz TurtleTweaks-v0.7.tar.gz abtts-v0.1.tar.gz abtts-v0.2.tar.gz abtts-v0.3.tar.gz blpconvert-v1.0.tar.gz clutch-v1.0.tar.gz jbmafp-v0.1.tar.gz jbmafp-v0.2.tar.gz jbmafp-v0.3.tar.gz lazycommit-v1.0.tar.gz makext-v1.0.tar.gz mprogress-v1.0.tar.gz newsbarge-v0.1.tar.gz oberon-v1.0.tar.gz p9tree-v1.0.tar.gz pats-v1.0.tar.gz pats.fossil rssperado-v1.0.tar.gz sm-v1.0.tar.gz sparklines-v1.0.tar.gz ttdaw-v0.1.tar.gz xmagnify-v1.0.tar.gz xmagnify.fossiltemplates
.gitkeep 404.html base.html bookmarks.html feed.xml index.html note.html page-no-title.html page.html post.html robots.txt sitemap.xml
content/notes/2026-06-08-list-uptime-history.md
raw
1---
2title: Show uptime per boot session on Linux systems
3url: show-uptime-per-boot-session-on-linux-systems.html
4date: 2026-06-08T16:13:13+02:00
5type: note
6draft: false
7tags: []
8---
9
10Parses `last reboot` output to show how long each boot session lasted, sorted
11longest-first. The `-F` (full date) and `-w` (wide) flags give complete
12timestamps.
13
14```sh
15last reboot -F -w | awk '
16/^reboot/ {
17 start = $5" "$6" "$7" "$8" "$9
18 cmd = "date -d \"" start "\" +%s"
19 cmd | getline ts
20 close(cmd)
21
22 if (prev_ts != "") {
23 diff = prev_ts - ts
24 days = int(diff / 86400)
25 hours = int((diff % 86400) / 3600)
26 mins = int((diff % 3600) / 60)
27
28 printf "%4dd %02dh %02dm booted: %s\n", days, hours, mins, start
29 }
30
31 prev_ts = ts
32}' | sort -nr
33```
34
35
36The results should look something like this:
37
38```txt
39 191d 22h 58m booted: Thu Nov 20 18:22:58 2025
40 89d 04h 49m booted: Wed Apr 2 09:23:05 2025
41 85d 01h 48m booted: Wed Jul 23 13:08:34 2025
42 48d 22h 04m booted: Fri Dec 6 17:38:10 2024
43 43d 11h 34m booted: Tue Oct 1 07:11:49 2024
44 40d 19h 27m booted: Thu Feb 20 12:55:40 2025
45 35d 04h 26m booted: Thu Oct 16 14:56:34 2025
46 26d 21h 12m booted: Fri Jan 24 15:43:01 2025
47 22d 23h 51m booted: Wed Nov 13 17:46:13 2024
48 22d 22h 55m booted: Mon Jun 30 14:12:51 2025
49 6d 05h 52m booted: Sun May 31 18:21:19 2026
50 4d 00h 24m booted: Thu Sep 26 07:33:16 2024
51 1d 22h 32m booted: Sun Jun 7 00:13:43 2026
52 0d 23h 13m booted: Mon Sep 30 07:58:09 2024
53 0d 01h 01m booted: Thu Sep 26 05:46:49 2024
54 0d 00h 45m booted: Thu Sep 26 06:48:05 2024
55 0d 00h 05m booted: Thu Sep 26 05:41:34 2024
56 0d 00h 05m booted: Thu Sep 26 05:33:34 2024
57 0d 00h 02m booted: Thu Sep 26 05:39:08 2024
58```