Files
lk/system/systemd/journal.md

45 lines
575 B
Markdown

---
title: "journal"
tags: [ "systemd" ]
---
See a running log of all system messages:
```sh
journalctl -f
```
Or just one user:
```sh
journalctl --user -f
```
Or just one unit (`sshd`):
```sh
journalctl -f -u sshd
```
Find errors since November
```sh
journalctl --since=2018-11-01 --grep="EXT4-fs error"
```
Limit size to 2G.
```sh
journalctl --vacuum-size=2G
```
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:
```sh
logger "Installed new dnsmasq"
sudo journalctl -f
```