Linux Log Viewer
2025-01-08
The journald
daemon collects logs.
journalctl
is used to view them.
journalctl
Displays every journal entry in the system, starting with the oldest. Pages using less
.
journalctl -b
sudo mkdir -p /var/log/journal
And, in /etc/systemd/journalctl.conf
:
[Journal]
Storeage=persistent
journalctl --list-boots
Output:
-2 cafg.... Date time stuff
-1 abx...
0 abcbootID....
journalctl -b -1
or by boot ID:
journalctl -b abcBootID....
journalctl --since "YUYYY-MM-DD HH:MM:SS"
If date is omitted, Today will be assumed. If the time is ommited, midnight is substituted.
journalctl --since "2024-06-11" --until ""2024-06-12 17:05"
journalctl --since yesterday # yesterday, today, tomorrow, now
journalctl -u bluetooth.service
journalctl _PID=1234
id -u www-data # Return UID
Output:
33
then:
journalctl _UID=33 --since today
journalctl -F _GID
List all entries for bash executable
journalctl /usr/bin/bash
Useful if executable doesn't have a unit available (-u)
Â