Belajar Sendiri

Commands

sudo journalctl -u

sudo journalctl -u <service> [-n N] [-f] [-g word]

Risk: Safe

What it does

Reads the journal, systemd's diary of what services said.

When to use it

A service failed and you need to know why.

Example

$ sudo journalctl -u nginx -n 20

The last 20 lines from nginx.

$ sudo journalctl -u nginx -f

Watch new lines live. Ctrl+C stops.

$ sudo journalctl -u nginx -g emerg

Only lines with emerg.