So I have a command that crashes the computer, and I wanted to see the output of dmesg to figure out the reason.
I saw that there is an -w option that allows dmesg to follow the process, but the problem is it does not exit so I cannot run the command following dmesg -w.
I tried
> #!/bin/bash
> dmesg -w &
> echo image.raw | /sys/device/platform/inject_frame
but that still doesn't run in the background. Any advice on what can I do?
The kernel version I am using is 4.9.241
edit:
Solution is provided by Harry , and is in the comment section. At the end I did (sudo journal -fk | sudo dd=log.txt) & to do what I desired, which is to capture the log of following actions to log.txt
To see what journalctl is different from dmesg, you can check it out here: https://www.reddit.com/r/redhat/comments/n3b278/can_someone_briefly_explain_the_major_differences/ What is the difference between dmesg and journalctl