The systemd journal contains logs from several boots.
Display only entries belonging to the current boot session.
Which command is correct?
journalctl -b selects the current boot ID and shows the full journal for that boot, not only kernel messages.
Detailed explanation
journalctl -bCorrect. journalctl -b selects entries from the current boot.
Correct. journalctl -b selects entries from the current boot.
journalctl -k -1Incorrect. -k -1 selects kernel messages from a previous boot.
Incorrect. -k -1 selects kernel messages from a previous boot.
journalctl -fIncorrect. -f follows new entries rather than selecting the current boot only.
Incorrect. -f follows new entries rather than selecting the current boot only.
journalctl --vacuum-time=1dIncorrect. --vacuum-time deletes old journal data rather than displaying it.
Incorrect. --vacuum-time deletes old journal data rather than displaying it.
Try it yourself
An example you can run in a temporary verification environment.
journalctl -b -n 5 --no-pager 2>/dev/null || echo 'systemd journal is unavailable'Expected result
現在起動の末尾5件、またはjournal未利用の表示Key points
- -b selects the current boot
- -k limits output to kernel messages
- -f follows new entries
Notes
- Environment: Linux / systemd journal 255以降
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.