I've found one way so far: less +G filename
, but it scrolls up line-by-line only with ↑.
What's a more powerful less
usage which provides scrolling by page, backward pattern search, and so on?
Under a UNIX shell, how can I get a similar effect to the watch
command, but with paging so that I can scroll around in the output if it takes up more than one screen?
In other words, I want a program that is to watch
what less
is to cat
.
As an example, lets say I wanted to watch the output of qstat
, I could use
watch qstat
to watch the output of qstat, but this can only shows the first screenful.
With a paging version of watch
, I would be able to move around in the output as it is still continuously updated by watch
. Is there any way to do this at the moment with existing utilities?
The question is based on this answer.
How can you set the -R in your LESS environment variable?
I'm trying to solve a common annoyance: when SSH'd into remote servers I often do things that produce a lot more output than I'm expecting. For example, grepping a large log file with a pattern that turns out to be too general. As garbage churns by I sit there hitting ^C and wishing I'd remembered to pipe to less. My best idea so far has been to try to configure my shell to always page output, I asked another question about that. Other than that, I only have less-than-optimal solutions:
What do you do?