Linux Commands Helper
💬 Your AI-powered Linux assistant
journalctl Command - Query and Display Logs from systemd Journal
The journalctl command is used to query and display logs collected by systemd's journal service. It provides powerful filtering and formatting options for system logs.
Syntax
journalctl [options]
Examples
journalctl -b
Show logs from the current boot.
journalctl -u sshd
Show logs for the sshd service.
journalctl --since "2024-01-01" --until "2024-01-31"
Show logs within a specific date range.
Notes
- Requires root privileges for some logs.
- Use
-f
to follow logs in real time (liketail -f
). - For persistent logs, ensure
/var/log/journal/
exists.