2022-01-16 18:20:39 +00:00
|
|
|
---
|
|
|
|
title: "journal"
|
2022-01-26 22:35:07 +00:00
|
|
|
tags: [ "Documentation", "systemd" ]
|
2022-01-16 18:20:39 +00:00
|
|
|
---
|
2024-02-28 17:45:21 +00:00
|
|
|
|
|
|
|
See a running log of all system messages:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
journalctl -f
|
|
|
|
```
|
|
|
|
|
|
|
|
Or just one unit (`sshd`):
|
|
|
|
|
|
|
|
```bash
|
|
|
|
journalctl -f -u sshd
|
|
|
|
```
|
|
|
|
|
2020-01-02 00:04:35 +00:00
|
|
|
Find errors since November
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
journalctl --since=2018-11-01 --grep="EXT4-fs error"
|
|
|
|
```
|
2020-01-02 00:04:35 +00:00
|
|
|
|
|
|
|
Limit size to 2G.
|
|
|
|
|
2023-06-17 19:28:20 +00:00
|
|
|
```bash
|
|
|
|
journalctl --vacuum-size=2G
|
2024-02-28 17:36:56 +00:00
|
|
|
```
|
|
|
|
|
2024-02-28 17:45:21 +00:00
|
|
|
Log the fact that you've installed your own `dnsmasq` on your system to `journalctl`, so that you can notice why your system's broken:
|
|
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
logger "Installed new dnsmasq"
|
|
|
|
sudo journalctl -f
|
|
|
|
```
|
|
|
|
|