2
  • less -S is useful to have horizontal scrolling with arrow keys (like mentioned in Horizontal scrolling in smaller increments with less -S) instead of breaking long lines into multiple lines

  • less +F, or alternatively less and then SHIFT+F, is useful to have less behave like tail -f with files being appended in realtime

However it seems impossible to have both at the same time.

Question: Is it possible to have less (or another tool) display currently-being-appended files in realtime, and also be able to scroll horizontally long lines (instead of breaking lines into multiple lines)?

This question comes from the context of dealing with Putty with a virtual console width of 2000 characters.

Marcus Müller
  • 21,602
  • 2
  • 39
  • 54
Basj
  • 2,351
  • 9
  • 37
  • 70
  • Hm, what if you have a really long line, so you scroll right; all the shorter lines are now invisible. Now, new lines come in, and less autoscrolls; what is the desired behaviour? – Marcus Müller Jul 18 '21 at 20:27
  • @MarcusMüller In the case you describe, the only visible line (the super long line) would move up each time a new line arrives. Then you notice "Oh new lines arrived, I'll scroll left to see them". – Basj Jul 18 '21 at 20:29

1 Answers1

-1

the easiest solution might be to start journalctl --no-pager -f in a scrollable thing like screen.

Marcus Müller
  • 21,602
  • 2
  • 39
  • 54
  • Just to be sure, why `journalctl`? I'd like to be able to do this for every log file like `/var/log/apache2/other_vhosts_access.log` or a custom txt file, or even, in real-time, the output of a Python script that takes time to print the output, line after line. See the edit at the end of https://superuser.com/questions/1663006/putty-ssh-with-a-virtual-console-width-of-2000-characters, maybe you will have a super general solution to this problem :) – Basj Jul 18 '21 at 20:46
  • ah sorry, I was somewhere with my brain; yeah, then `tail -f /some/log/file` instead of `journalctl --no-pager` – Marcus Müller Jul 18 '21 at 22:15
  • 1
    Is `screen` horizontally scrollable, and does it prevent to break long lines into several lines @MarcusMüller? – Basj Jul 19 '21 at 07:05