journalctl
systemLinux
The journalctl command is one of the most frequently used commands in Linux/Unix-like operating systems. journalctl Query and display messages from the systemd journal
Quick Reference
Command Name:
journalctl
Category:
system
Platform:
Linux
Basic Usage:
journalctl [options] [arguments]
Common Use Cases
Syntax
journalctl [OPTIONS...] [MATCHES...]
Options
Option | Description |
---|---|
-f, --follow |
Follow the journal (show new entries as they're added) |
-n, --lines= |
Show the most recent N journal entries |
-r, --reverse |
Show oldest entries first |
-o, --output= |
Change output mode (short, verbose, json, etc.) |
-p, --priority= |
Filter by priority (emerg, alert, crit, err, warning, notice, info, debug) |
-b, --boot[=ID] |
Show messages from a specific boot |
--since=, --until= |
Show entries since or until the specified date/time |
-u, --unit= |
Show logs from the specified systemd unit |
-k, --dmesg |
Show kernel message log from the current boot |
--no-pager |
Do not pipe output into a pager |
--no-hostname |
Suppress hostname field in the output |
--disk-usage |
Show total disk usage of all journal files |
--vacuum-size=, --vacuum-time= |
Remove journal files until the specified size or age is reached |
--list-boots |
Show a list of recorded boots |
_SYSTEMD_UNIT=, _PID=, _UID=, etc. |
Match specific journal fields (systemd unit, PID, UID, etc.) |
Examples
How to Use These Examples
The examples below show common ways to use the journalctl
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
journalctl