Skip to content

journalctl command

Read systemd logs for services and the system.

On this page

Syntax

journalctl [options]

Provided by the systemd package. Run man journalctl for the full manual.

Common options

OptionWhat it does
-u UNITLogs of one service
-fFollow new entries
-n NLast N lines
-bSince the last boot (-b -1 = previous boot)
--since / --untilTime range, e.g. "1 hour ago"
-p LEVELPriority, e.g. err
-kKernel messages
--disk-usageSpace used by the journal
--vacuum-size=SIZEShrink the journal

Examples

  1. Logs of a service

    journalctl -u nginx
  2. Follow a service live

    journalctl -u nginx -f
  3. Last 100 lines

    journalctl -u ssh -n 100
  4. Since the last boot

    journalctl -b
  5. Errors only

    journalctl -p err -b
  6. Last hour

    journalctl --since "1 hour ago"
  7. Kernel messages

    journalctl -k
  8. Shrink the journal to 500 MB

    sudo journalctl --vacuum-size=500M

journalctl guides

← All Linux commands · Suggest a fix

Back to top