1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 06:22:07 +02:00

journalctl: add "logs from last unit start" example (#11578)

Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
This commit is contained in:
Ilya Mashchenko 2023-12-29 17:00:45 +02:00 committed by GitHub
parent 4634eacca5
commit 7ec97b40d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,10 +7,6 @@
`journalctl -b --priority={{3}}`
- Show all messages from last [b]oot:
`journalctl -b -1`
- Delete journal logs which are older than 2 days:
`journalctl --vacuum-time={{2d}}`
@ -23,6 +19,10 @@
`journalctl -u {{unit}}`
- Show logs for a given unit since the last time it started:
`journalctl _SYSTEMD_INVOCATION_ID=$(systemctl show --value --property=InvocationID {{unit}})`
- Filter messages within a time range (either timestamp or placeholders like "yesterday"):
`journalctl --since {{now|today|yesterday|tomorrow}} --until {{YYYY-MM-DD HH:MM:SS}}`