Display only journal entries from the current boot.
Which command is appropriate?
journalctl -b filters entries to the current boot; -b -1 selects the previous boot.
Detailed explanation
journalctl -kIncorrect. -k filters kernel messages.
Incorrect. -k filters kernel messages.
journalctl -fIncorrect. -f follows new entries from the end.
Incorrect. -f follows new entries from the end.
journalctl -bCorrect. -b selects the current boot.
Correct. -b selects the current boot.
journalctl -u boot.serviceIncorrect. -u filters a systemd unit.
Incorrect. -u filters a systemd unit.
Try it yourself
An example you can run in a temporary verification environment.
journalctl --help 2>&1 | grep -E -- '--boot| -b' | head -n 1Expected result
-bまたは--bootのhelp行Key points
- -b boot filter
- -1 previous boot
- Different from -k and -f
Notes
- Environment: journalctl helpの読取のみ
- 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.