linuxsystemdjournal

How to save output of journalctl --verify


I am trying to redirect the output of the command "journalctl --verify" into a log file with "journalctl --verify > test.log" but the test.log is empty when I see the output on the console.

Am I doing something wrong or is there another way to do this?


Solution

  • Found out that I need to add 2>&1 to the end of the command to make it work.

    "journalctl --verify > test.log 2>&1"