Updated 8 hours ago
Something broke. Your web server returned errors, a service failed to start, or the system rebooted unexpectedly. Somewhere in the logs is the answer—but modern Linux systems generate millions of log entries. Finding the relevant ones by scrolling through text files isn't just tedious, it's often impossible.
The systemd journal changes the game. Instead of scattered text files, it maintains a centralized binary database capturing everything: kernel messages, service output, authentication events, application logs. And journalctl lets you query it.
Traditional logs are text files you grep blindly. The journal is a database you can query.
Viewing the Journal
See all journal entries:
This dumps everything—potentially millions of entries. The output uses a pager, so press G to jump to the end (recent entries) or q to quit.
More useful: show entries in reverse chronological order, most recent first:
Or follow new entries as they arrive, like tail -f:
Press Ctrl+C to stop following.
Filtering by Time
This is where the journal's structure pays off. Show only logs from the current boot:
After a reboot, this filters out all historical noise. See logs from a previous boot:
List all recorded boots:
Filter by specific time ranges:
Relative times like "1 hour ago" save you from timestamp arithmetic at 3am.
Filtering by Service
Show logs from a specific systemd service:
Combine with time filters:
View multiple services:
Filtering by Priority
Log messages have priority levels from 0 (emergency) to 7 (debug). Show only messages at or above a severity:
This cuts through noise immediately. Show all errors from the current boot:
Filtering by Process
When you know the process but not the service unit:
Combining Filters
Here's where journalctl's power becomes clear. Show nginx errors from the last hour:
Follow SSH logs from the current boot:
Critical messages from any service since yesterday:
Filters combine with AND logic—all conditions must match.
Output Formats
Default output is human-readable. For all metadata:
For machine-parseable JSON:
Minimal format:
Kernel Messages
Show only kernel messages (equivalent to dmesg):
Searching Within Logs
Use grep on journal output:
Or search within the pager: press / to search forward, ? to search backward.
Limiting Output
Show only the last N entries:
Useful when a service just failed and you want recent context.
Managing Disk Space
Check journal size:
Clean up old entries:
For permanent limits, edit /etc/systemd/journald.conf:
Exporting Logs
Save logs for sharing or analysis:
User Logs
Regular users can view their own journal entries without sudo:
Troubleshooting Patterns
Service won't start? Check its recent logs:
System acting strange after reboot? Compare current and previous boot:
Looking for patterns? Pipe to standard tools:
Frequently Asked Questions About journalctl
Was this page helpful?