0

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

Output of systemctl status

1
  • 4
    It's not bash that's doing it. Is it only systemctl 's behavior that changed? – Jeff Schaller Apr 8 '17 at 11:42
5

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, including less(1) and more(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
2
  • 1
    Thank you very much, it works! Is there a way to make this permanent and for all users? – user180820 Apr 9 '17 at 18:56
  • Or export SYSTEMD_PAGER="" – Mubin Icyer Apr 8 at 11:33
0

More widely, you can define PAGER environment in your bash runtime config

# In .bashrc or .bash_profile

export PAGER='cat'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.