tldr/pages/linux/journalctl.md

37 lines
832 B
Markdown
Raw Normal View History

2014-02-25 02:13:55 +00:00
# journalctl
> Query the systemd journal.
> More information: <https://manned.org/journalctl>.
2014-02-25 02:13:55 +00:00
- Show all messages with priority level 3 (errors) from this [b]oot:
2014-02-25 02:13:55 +00:00
`journalctl -b --priority={{3}}`
2014-02-25 02:13:55 +00:00
- Show all messages from last [b]oot:
2014-02-25 02:13:55 +00:00
`journalctl -b -1`
- Delete journal logs which are older than 2 days:
`journalctl --vacuum-time={{2d}}`
- [f]ollow new messages (like `tail -f` for traditional syslog):
2014-02-25 02:13:55 +00:00
`journalctl -f`
- Show all messages by a specific [u]nit:
2014-02-25 02:13:55 +00:00
`journalctl -u {{unit}}`
- Filter messages within a time range (either timestamp or placeholders like "yesterday"):
2019-08-17 05:30:03 +01:00
`journalctl --since {{now|today|yesterday|tomorrow}} --until {{YYYY-MM-DD HH:MM:SS}}`
- Show all messages by a specific process:
2014-02-25 02:13:55 +00:00
`journalctl _PID={{pid}}`
- Show all messages by a specific executable:
2014-02-25 02:13:55 +00:00
`journalctl {{path/to/executable}}`