If I issue a SysRq command, how do I redirect that output (whether it is stdout or stderr is documented nowhere) to |less, |more or |tee?

  • 1
    it's neither: it's kernel's printk(). dmesg might have it, perhaps – A.B Apr 21 '18 at 14:58
  • @A.B printk goes in an endless loop? – neverMind9 Apr 21 '18 at 15:36
  • 1
    try this: SysRq h (to print the help). then run dmesg. You should see the help printed in this output. It ends up somewhere in /var/log/ but that depends on your distribution – A.B Apr 21 '18 at 15:50
  • 2
    The context is unix.stackexchange.com/questions/439131 . – JdeBP Apr 21 '18 at 17:13

You can't specifically redirect the output caused by an Alt+SysRq request. It goes to the console.

The output caused by Alt+SysRq is sent to the kernel logs, so if you want to read it after the fact, you can look for it in the output of the dmesg command, or wherever your system stores the kernel logs (e.g. /var/log/kern.log`).

If you're able to type a shell command line, then why would you use Alt+SysRq instead of some equivalent shell command anyway? Alt+SysRq is intended for emergency situations where you can't access the computer normally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.