Linux for Developers
/Intermediate
journalctl
Definition
The command-line utility used to query and read the centralized, binary log data collected by systemd. It replaces the need to manually read traditional text files in `/var/log`.
Explain Like I'm New
The modern search engine for system logs. Instead of using `grep` on 50 different text files, `journalctl` keeps all the logs in a giant, highly-searchable database.
Real World Example
A database service (PostgreSQL) fails to start. Instead of hunting for the specific postgres log file, the admin types `journalctl -u postgresql`. It instantly prints ONLY the logs associated with that specific service, revealing the exact error.
Common Use Cases
- •Debugging systemd services
- •Viewing boot errors
Interview Questions
basic
- Can you open systemd journal logs using a normal text editor like Nano or Vim?
intermediate
- What does the command `journalctl -b` do?