Re:Assorted Less(1) Tips
by marcosdumay on Friday January 02, 2026 @11:51AM
(#46466674)
I'm reading it correctly that it will cause less to exit if you scroll until the end of file even if the file is larger than the terminal size?
Yeah; in both cases (text is larger or smaller than terminal) it makes "less" act the same as "more" with auto-exiting.
I hate -E. Quitting immediately does not do good things to my muscle memory. I’m using to hitting q to quit less when I am done. Now the q key becomes part of the input to the shell prompt (or worse if there’s a different tool invoking less and now q might be interpreted differently by that tool). I value the consistency of user interaction more than saving a keystroke.
I recommend -FX instead of -EX. They both quit immediately if the output is smaller than the screen size, but -FX does not quit if the output is larger and you jump to the end of a large file, so you can continue to do things like scroll back or search.
git uses "less -FRX" by default. This is how I learned about -F.
(To be pedentic, git uses "LESS=FRX less", which accomplishes the same thing.)
...And combined with some of the other options in the post, my go-to has been "less -SEXIER" for a long time. Specifying E twice doesn't seem to do anything except make this easier to remember.