0

When I search in journalctl with / the search is case sensitive unless I switch to case insensitive with -i first.

How can I configure journalctl so that searches are case insensitive by default?

1
alias journalctli="SYSTEMD_PAGER='less -i' journalctl"

or add

export SYSTEMD_PAGER="less -i"

to any of these files: ~/.bash_profile, /etc/environment or /etc/profile.d/journalctl.sh

2
  • Thanks, that works. Do you know why less does not use export LESS="-i" when I use it with export SYSTEMD_PAGER=less?
    – laktak
    Sep 11 '20 at 17:46
  • less is a separate utility and has its own environment parameters. They are not connected in any way - systemd can use any other pager, e.g. more. Sep 11 '20 at 20:23
0

For some reason journalctl does not use the LESS environment variable but uses SYSTEMD_LESS:

  $SYSTEMD_LESS
      Override the options passed to less (by default "FRSXMK").

Since less is already the default pager you can configure

export SYSTEMD_LESS=-i

or use the same options as less:

export SYSTEMD_LESS="$LESS"

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.