0

Imagine you would want less to auto scroll to the end. Easy, as its manual states, do less +G.

Imagine you would want less to start at the beginning but after soaking its whole input. Easy, do less +Gg (to the end then back to the beginning), it supports several command chaining. Don't you believe? Chain Gg sequences enough, and you will end up watching less go back and forth.

Imagine you would want less to advance to the sixth occurrence of the == sequence. Can't use less +/==nnnnn! That searches ==nnnnn, instead of searching == and then searching next five times. What to do now?

  • Use cat or grep? – Seth Aug 1 at 9:22
  • Grep then More is a reasonable alternative, as it is just hitting the N key five times. However multiple separate commands just working is perfect. – 174140 Aug 1 at 12:23
2

Imagine you could, in fact, specify multiple separate commands like this:

less +/== +nnnnn


 

If that hadn't worked, you could embed a literal newline in the parameter:

less $'+/==\nnnnnn'
less "+/==
nnnnn"
  • All of those totally make sense. I don't know why, I can't run any of the three in my Konsole unless inside a nested Tmux organizer, nor in tty1 to tty6 unless inside a nested Tmux organizer. This is Debian GNU/Linux stretch 9.9 in lsb_release -a. – 174140 Aug 1 at 12:20
  • Compare type less and printenv LESS in both. – grawity Aug 1 at 12:25
  • less is /usr/bin/less in all three of: tty1 to tty6, inside Tmux, and in Konsole; in all three cases printenv LESS does not show anything, returning an exit status code of 1. – 174140 Aug 1 at 16:37

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.