On this page 11 sections
What journalctl does
journalctl reads logs collected by systemd-journald. It provides access to service logs, kernel events, boot messages and system activity from a single interface.
journalctljournalctl -rLogs for a specific service
The -u option filters logs by systemd unit. This is one of the most useful commands when troubleshooting a service.
journalctl -u sshjournalctl -u nginxjournalctl -u ssh -n 50Follow logs in real time
-f behaves similarly to tail -f and continuously displays new events as they are written.
journalctl -fjournalctl -u ssh -fFilter by time
--since and --until allow logs to be restricted to a specific time range.
journalctl --since todayjournalctl --since "1 hour ago"journalctl --since "2026-08-18 18:00" --until "2026-08-18 20:00"Filter by priority
The -p option filters messages by syslog priority. Useful values include emerg, alert, crit, err, warning, notice, info and debug.
journalctl -p errjournalctl -p warningBoot logs
journalctl can separate logs by system boot. -b shows the current boot, while negative indexes inspect previous boots.
journalctl -bjournalctl -b -1journalctl --list-bootsKernel logs
-k displays kernel messages recorded in the journal. This is useful for drivers, hardware, networking and filesystem problems.
journalctl -kjournalctl -k -p errFilter by process
Logs can also be filtered by process ID, executable or other journal fields.
journalctl _PID=1234journalctl _COMM=sshdShow only the message
Output formats can make journalctl easier to use in scripts or pipelines.
journalctl -u ssh -o catjournalctl -u ssh -o jsonDisk usage and cleanup
The journal can consume disk space over time. journalctl can report usage and remove older entries according to size or age.
journalctl --disk-usagesudo journalctl --vacuum-time=7dsudo journalctl --vacuum-size=500MPractical troubleshooting workflow
When a service fails, first inspect its systemd status and then move into journalctl for the detailed event history.
systemctl status nginxjournalctl -u nginx -n 100journalctl -u nginx -f