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 _UID=$(id -u) shows what your own processes logged

Journalctl
~/tips/tip-journalctl-uid-match-own-processes

journalctl --since today _UID=$(id -u)

Shows the journal entries written by processes that run under one user ID, for example your own.

On a shared machine I like to see my own entries first and ignore the rest.

_UID is the user ID of the process that wrote the entry. id -u prints yours, so the command shows what your own programs logged today. Swap in another number to look at one service account.

journalctl --since today _UID=$(id -u)

Only entries that carry the _UID field match, and that is most of them but not all. Reading other people’s entries still needs the right permissions.

Further reading: journalctl(1) manual page, systemd.journal-fields(7) 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