Constantly display status line in less
-M option (also
--LONG-PROMPT) does this.
A few variations are listed in the manual:
Causes less to prompt verbosely (like more), with the percent into the file. By default, less prompts with a colon.
Causes less to prompt even more verbosely than more.
If you want to change the prompt (as it's called),
-P is probably what you want (quote from the manual):
-Pprompt or --prompt=prompt
Provides a way to tailor the three prompt styles to your own preference.
-Psfollowed by a string changes the default (short) prompt to that string.
-Pmchanges the medium (-m) prompt.
-PMchanges the long (-M) prompt. [...] See the section on PROMPTS for more details.
There's a bunch of variables you can use presented in the section on prompts. On my system, the
= prompt displays lines and bytes, so let's set the
$LESS variable to show lines and bytes that are visible on the screen in the short (default) prompt:
$ LESS='-Pslines %lt-%lb (%Pt-%Pb \%) bytes %bt-%bb file %f' ; export LESS $ less foo
displays a prompt like
lines 1-44 (1-53 %) bytes 0-2498 file foo
%b for lines, percentage and bytes, trailing
b for "top" and "bottom" of screen.
\ are special and need to be escaped.)
The default prompt also has conditionals to not show fields that are unknown, and also to show
(END) instead of
100% at the end of file. As an example, the latter can be done with