DEV Community

João Vitor
João Vitor

Posted on

Keep man output in the screen

Reading man man I found out that the pager used by man can be overridden.

 -P pager, --pager=pager
              Specify which output pager to use.  By default, man uses
              less, falling back to cat if less is not found or is not
              executable.  This option overrides the $MANPAGER
              environment variable, which in turn overrides the $PAGER
              environment variable.  It is not used in conjunction with
              -f or -k.

              The value may be a simple command name or a command with
              arguments, and may use shell quoting (backslashes, single
              quotes, or double quotes).  It may not use pipes to
              connect multiple commands; if you need that, use a wrapper
              script, which may take the file to display either as an
              argument or on standard input.
Enter fullscreen mode Exit fullscreen mode

MANPAGER variable

export MANPAGER="less -FirSwX"
Enter fullscreen mode Exit fullscreen mode

And after closing man you can still read the man page that you were reading.

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more