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 --file reads one journal file or a set of them by glob

Journalctl
~/tips/tip-journalctl-file-glob-single-journal

journalctl --file='/var/log/journal/*/system.journal' -n 20

Reads the entries of specific journal files matching a glob instead of the system journal.

A journal file copied from somewhere does not need to live in a standard directory to be read.

--file=GLOB reads only the files that match the pattern. You can repeat it, and the entries of the files are interleaved in time order. It is the quickest way to open one file that someone sent you.

journalctl --file='/var/log/journal/*/system.journal' -n 20

The man page lists a short -i too, but on systemd 255 on Ubuntu 24.04 only the long form worked. Quote the glob, so your shell leaves it to journalctl.

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