Piped output wierdness with 'COMMAND | less', FreeBSD

1

I'm using FreeNAS 9.2.10 console, which is based on FreeBSD. I'm trying to pipe the output of commands through less as a pager: zfs list -v <poolname> | less.

What I get is the tail of the file - almost certainly not all of it since it starts 3/4 of the way through the alphabetic list at "R". In any case whatever I press to scroll up or down (page down, down arrow, space, enter), I get a page of tildes

~
~
~
~
~
~
END
:

and can't see the file or page back (page up, up arrow, b, or whatever). I tried using -z10 both directly and via setenv to force a known situation where its page size was << file size, but it didn't do anything different.

What's going on, or what am I derping?

Stilez

Posted 2017-02-28T00:41:13.267

Reputation: 1 183

Could it be that everything goes to stderr? – Mateusz Piotrowski – 2017-02-28T00:48:52.423

Tildes mean that there is nothing to see from what I remember. You can try -~ option for less to get rid of them in case they are added by less. – Mateusz Piotrowski – 2017-02-28T00:50:57.087

You can also try more instead. – arrowd – 2017-02-28T06:02:14.487

I tried more; it was even less helpful (no puns intended) – Stilez – 2017-02-28T10:39:36.713

Answers

1

Behavior like that generally indicates that the output is going to stderr rather than stdout. You can force it to go to stdout instead by using 2>&1, like this: zfs list -v <poolname> 2>&1 | less.

Joseph Sible-Reinstate Monica

Posted 2017-02-28T00:41:13.267

Reputation: 1 420