journalctl
and systemd,, and more
Syntax
journalctl [options]
Parameters
| Parameters | Description | Examples | Level |
|---|---|---|---|
-u |
|
Common | |
-f |
( tail -f) | |
Common |
-n |
N | |
Common |
--since |
|
Common | |
-p |
(emerg/alert/crit/err/warning/notice/info/debug) | |
Common |
-b |
|
Common |
Examples
nginx
journalctl -u nginx -f
MySQL
journalctl -u mysql --since '1 hour ago'
journalctl -p err -b
journalctl --since '2024-01-01' --until '2024-01-02'
nginx 500
journalctl -u nginx --no-pager | grep 500
journalctl --disk-usage
Tips
- --no-pager grep
- journalctl --vacuum-size=500M 500MB
- JSON : journalctl -u nginx -o json-pretty
- -xe, Common