systemd-cat – Connect a pipeline or program’s output with the journal

Example 1. Invoke a program

This calls /bin/ls with standard output and error connected to the journal:

# systemd-cat ls

Example 2. Usage in a shell pipeline

This builds a shell pipeline also invoking /bin/ls and writes the output it generates to the journal:

# ls | systemd-cat

Even though the two examples have very similar effects the first is preferable since only one process is running at a time, and both stdout and stderr are captured while in the second example, only stdout is captured.

Leave a Reply

Your email address will not be published. Required fields are marked *