Prevent less from Clearing the Screen upon Exit on Linux

Posted on July 21, 2018 at 2:55 pm

To prevent less from clearing the screen upon exit you can just use -X option:

-X or –no-init

Disables sending the termcap initialization and deinitialization strings to the terminal. This is sometimes desirable if the deinitialization string does something unnecessary, like clearing the screen.

To make less exit if the content fits on one screen, just use -F option:

-F or –quit-if-one-screen

Causes less to automatically exit if the entire file can be displayed on the first screen.

Read more on less Linux Man Page

Receive updates via email

Other Posts

Updated Posts