Solved Capturing zfs get output

Installed V10.3 with zfs on a single drive. Default values everywhere, except CanFrench kb.

The command zfs get appears to display more than one screen (about 25 lines). How can I get to see the top lines? The following attempts do not seem to capture the output:

zfs get|less
The last lines are displayed. ESC-v should display one-page up, but instead displays blank lines preceded by ~ (or something like it)

zfs get > zfsget.out
Again lines are displayed, but the file is empty.
 
ram00, zfs get prints its output on stderr.

A common way to scroll through text written to stderr, is to use your shell to merge stderr with stdout before piping the output to a pager like less(1).

If you're using a Bourne style shell, try zfs get 2>&1 | less.

If you're using a csh style shell (such as the default FreeBSD root account shell), try zfs get |& less.
 
It is possible that things changed in 10.3 (I know that a memory leak within ZFS got fixed) but on 10.1 the # zfs get command sends its output to stdout and not stderr. Which in my opinion is the normal behavior.

As said: it is possible that this got changed, but it doesn't sound very logical to me because regular output like this is normally not sent to stderr as it's not related to any errors.
 
ShelLuser, I think you're right about non-errors from zfs(8) normally going to stdout, yet zfs get's actually an error--it yields missing property argument. I guess that's why it's written to stderr; zfs get all outputs to stdout, like you're saying.
 
Back
Top