1

The commonly used pager less can be started with the option -S, prevents it from breaking lines.

One can then press the right and left arrow keys to scroll horizontally.

Since the lines can be quite long, I was wondering whether there a keystroke or a way to jump to the end of the line.

I know that one can increase the step size less uses for scrolling. The problem is, that less doesn't stop to scroll horizontally at the end of the line. Therefore just setting a high numerical value for the step size (scrolling increment) would usually put the view beyond the end of the line.

2

From the manual:

   ESC-} or ^RIGHTARROW
          Scroll horizontally right to show the end of the longest displayed line.

   ESC-{ or ^LEFTARROW
          Scroll horizontally left back to the first column.

These escape sequences were introduced in less version 487, released on 2016-10-25.

  • Seems like this is a new feature. For Ubuntu, it's only available starting from 18.04. – wjandrea Jul 13 '18 at 17:40
  • The version of Ubuntu is not as important as the version of less. – JdeBP Jul 13 '18 at 17:52
  • less -V yields less 487 (POSIX regular expressions) for me. – DopeGhoti Jul 13 '18 at 18:17

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.