Service & System
journalctl
Query and display messages from the systemd journal.
Synopsis
syntax
journalctl [OPTION]... [MATCH]...
Examples
Follow nginx logs in real time
journalctl -u nginx -f
Logs from the last hour
journalctl --since '1 hour ago'
Error-level messages this boot
journalctl -p err -b
Last 50 SSH logs without pager
journalctl -u sshd -n 50 --no-pager
Common options
| Flag | Description |
|---|---|
| -u | Show logs for a specific unit |
| -f | Follow new messages |
| -n | Show last N entries |
| --since | Show entries since time |
| -p | Filter by priority level |
| -b | Show entries from current boot |
| --no-pager | Output without paging |
About journalctl
The `journalctl` command query and display messages from the systemd journal. Service and system commands manage daemons, scheduled tasks, system boot, and shutdown operations.
Modern Linux distributions use systemd for service management, though some still support SysVinit scripts. Understanding these commands is essential for deploying and maintaining production services.
The command accepts 7 commonly used flags shown above, though the full set of options is available in the man page (`man journalctl`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.
Related commands
More Service & System Commands
Other commands in the Service & System category