After a recent update bash
seems to always output to less
, which is resulting in pagination for many commands. Does anyone know how to turn less
off?
Example output for systemctl status
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityAfter a recent update bash
seems to always output to less
, which is resulting in pagination for many commands. Does anyone know how to turn less
off?
Example output for systemctl status
The man page for systemctl
(man systemctl
) explains this behaviour clearly, and even offers options to change it:
$SYSTEMD_PAGER
Pager to use when--no-pager
is not given; overrides$PAGER
. If neither$SYSTEMD_PAGER
nor$PAGER
are set, a set of well-known pager implementations are tried in turn, includingless
(1) andmore
(1), until one is found. If no pager implementation is discovered no pager is invoked. Setting this environment variable to an empty string or the value "cat
" is equivalent to passing--no-pager
.
So in your case the solution is to set the environment variable when you log in:
export SYSTEMD_PAGER=cat
More widely, you can define PAGER environment in your bash runtime config
# In .bashrc or .bash_profile
export PAGER='cat'