cmdxray / commands / journalctl

What does journalctl do?

query and display logs from the systemd journal.

▸ Explain your own journalctl command →

journalctl examples, explained

$ journalctl -u nginx --since "1 hour ago" -f

  • journalctlquery and display logs from the systemd journal
  • -ushow logs for this systemd unit only
  • nginxvalue for -u
  • --sinceonly entries at or after this time (e.g. "1 hour ago")
  • 1 hour agovalue for --since
  • -ffollow — keep printing new log entries as they arrive

$ journalctl -xe -p err

  • journalctlquery and display logs from the systemd journal
  • -xadd explanatory help text to log messages where available
  • -ejump to the end of the journal in the pager
  • -pfilter by priority (e.g. err, warning, or 0-7)
  • erran argument passed to the command

journalctl flags & options

-ushow logs for this systemd unit only
--unitshow logs for this systemd unit only
--user-unitshow logs for this per-user unit only
-ffollow — keep printing new log entries as they arrive
--followfollow — keep printing new log entries as they arrive
--sinceonly entries at or after this time (e.g. "1 hour ago")
--untilonly entries at or before this time
-nshow only the last N lines
--linesshow only the last N lines
-ejump to the end of the journal in the pager
--pager-endjump to the end of the journal in the pager
-rreverse — show newest entries first
--reversereverse — show newest entries first
-kshow only kernel messages
--dmesgshow only kernel messages
-bshow logs from a specific boot (default: current boot)
--bootshow logs from a specific boot (default: current boot)
-xadd explanatory help text to log messages where available
--catalogadd explanatory help text to log messages where available
-pfilter by priority (e.g. err, warning, or 0-7)
--priorityfilter by priority (e.g. err, warning, or 0-7)
--no-pagerprint straight to the terminal, don't use a pager
--systemshow messages from system services and the kernel
--usershow messages from the current user's services
-oset the output format (short, json, cat, …)
--outputset the output format (short, json, cat, …)

Other commands

Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.