brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: journalctl -o short-unix gives time stamps scripts can calculate with

Journalctl
~/tips/tip-journalctl-output-short-unix

journalctl -o short-unix -u myapp

Prints the time as seconds since 1970 so a script can calculate with it.

A script wants a number it can subtract. A date with a month name is no help.

short-unix shows the seconds since 1 January 1970 UTC, with microsecond accuracy. Differences are one subtraction away, and a spreadsheet or a plot reads the column without any date parsing.

journalctl -o short-unix -u myapp

Humans cannot read it at a glance. Use it as an intermediate format and keep the default for your own eyes.

Further reading: journalctl(1) manual page

More Journalctl tips journalctl -k -g 'killed process' --since "2 days ago" journalctl _PID=1 -b ls -lh /var/log/journal/*/*.journal~ Storage=volatile sudo journalctl --setup-keys All Journalctl tips (81) All topics

Link