Some commands display their output in a pager, and don't return. Here is an example of such a command :
apt changelog zsh
From the man apt
page:
changelog
changelog downloads a package changelog and displays it through sensible-pager. The server name and
base directory is defined in the APT::Changelogs::Server variable (e. g.
http://packages.debian.org/changelogs for Debian or http://changelogs.ubuntu.com/changelogs for
Ubuntu). By default it displays the changelog for the version that is installed. However, you can
specify the same options as for the install command.
...But nothing anywhere about passing options to said sensible-pager
, or use another one.
How can I get, say, the N first lines of it, of better yet, parse the output to extract the information I need?