Is there any way to exit “less” without clearing the screen?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
62
down vote

favorite
17












Relatively often, I find myself wanting to quit less but leave what I was viewing on the screen, to refer back to. Is there any way to do this? Workarounds?



(My current workaround is to quit, then use more. So any workaround that's better than that is welcomed. The ideal would be something I can use once I'm already inside less, perhaps with a shell setting or some scripting.)



My desktop is OSX, but I use RHEL and Ubuntu servers.










share|improve this question



















  • 1




    Reading a long output (as in git diff or git log) in less -X will take up the scroll buffer in my terminal and evict much of the previous output. I'd love it if less could just exit with the last screenful of output at the time of the exit; i.e. no more than one page of the scroll buffer would be taken after quitting less. Any ideas?
    – musiphil
    Jan 9 '14 at 19:57










  • By the way, -R is usually a safer choice than -r.
    – musiphil
    Jan 9 '14 at 20:14










  • Thanks. For those wondering: -R is "Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained correctly in most cases."
    – Steve Bennett
    Jan 13 '14 at 4:20










  • @musiphil Perhaps -c?
    – Vanessa Phipps
    May 1 '14 at 16:46










  • @MatthewPhipps: I guess -c is about how to update the screen when you move around inside less.
    – musiphil
    May 1 '14 at 20:48














up vote
62
down vote

favorite
17












Relatively often, I find myself wanting to quit less but leave what I was viewing on the screen, to refer back to. Is there any way to do this? Workarounds?



(My current workaround is to quit, then use more. So any workaround that's better than that is welcomed. The ideal would be something I can use once I'm already inside less, perhaps with a shell setting or some scripting.)



My desktop is OSX, but I use RHEL and Ubuntu servers.










share|improve this question



















  • 1




    Reading a long output (as in git diff or git log) in less -X will take up the scroll buffer in my terminal and evict much of the previous output. I'd love it if less could just exit with the last screenful of output at the time of the exit; i.e. no more than one page of the scroll buffer would be taken after quitting less. Any ideas?
    – musiphil
    Jan 9 '14 at 19:57










  • By the way, -R is usually a safer choice than -r.
    – musiphil
    Jan 9 '14 at 20:14










  • Thanks. For those wondering: -R is "Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained correctly in most cases."
    – Steve Bennett
    Jan 13 '14 at 4:20










  • @musiphil Perhaps -c?
    – Vanessa Phipps
    May 1 '14 at 16:46










  • @MatthewPhipps: I guess -c is about how to update the screen when you move around inside less.
    – musiphil
    May 1 '14 at 20:48












up vote
62
down vote

favorite
17









up vote
62
down vote

favorite
17






17





Relatively often, I find myself wanting to quit less but leave what I was viewing on the screen, to refer back to. Is there any way to do this? Workarounds?



(My current workaround is to quit, then use more. So any workaround that's better than that is welcomed. The ideal would be something I can use once I'm already inside less, perhaps with a shell setting or some scripting.)



My desktop is OSX, but I use RHEL and Ubuntu servers.










share|improve this question















Relatively often, I find myself wanting to quit less but leave what I was viewing on the screen, to refer back to. Is there any way to do this? Workarounds?



(My current workaround is to quit, then use more. So any workaround that's better than that is welcomed. The ideal would be something I can use once I'm already inside less, perhaps with a shell setting or some scripting.)



My desktop is OSX, but I use RHEL and Ubuntu servers.







less termcap






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 8 '14 at 18:34









Andrew Marshall

1,505196




1,505196










asked May 14 '12 at 13:36









Steve Bennett

84331121




84331121







  • 1




    Reading a long output (as in git diff or git log) in less -X will take up the scroll buffer in my terminal and evict much of the previous output. I'd love it if less could just exit with the last screenful of output at the time of the exit; i.e. no more than one page of the scroll buffer would be taken after quitting less. Any ideas?
    – musiphil
    Jan 9 '14 at 19:57










  • By the way, -R is usually a safer choice than -r.
    – musiphil
    Jan 9 '14 at 20:14










  • Thanks. For those wondering: -R is "Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained correctly in most cases."
    – Steve Bennett
    Jan 13 '14 at 4:20










  • @musiphil Perhaps -c?
    – Vanessa Phipps
    May 1 '14 at 16:46










  • @MatthewPhipps: I guess -c is about how to update the screen when you move around inside less.
    – musiphil
    May 1 '14 at 20:48












  • 1




    Reading a long output (as in git diff or git log) in less -X will take up the scroll buffer in my terminal and evict much of the previous output. I'd love it if less could just exit with the last screenful of output at the time of the exit; i.e. no more than one page of the scroll buffer would be taken after quitting less. Any ideas?
    – musiphil
    Jan 9 '14 at 19:57










  • By the way, -R is usually a safer choice than -r.
    – musiphil
    Jan 9 '14 at 20:14










  • Thanks. For those wondering: -R is "Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained correctly in most cases."
    – Steve Bennett
    Jan 13 '14 at 4:20










  • @musiphil Perhaps -c?
    – Vanessa Phipps
    May 1 '14 at 16:46










  • @MatthewPhipps: I guess -c is about how to update the screen when you move around inside less.
    – musiphil
    May 1 '14 at 20:48







1




1




Reading a long output (as in git diff or git log) in less -X will take up the scroll buffer in my terminal and evict much of the previous output. I'd love it if less could just exit with the last screenful of output at the time of the exit; i.e. no more than one page of the scroll buffer would be taken after quitting less. Any ideas?
– musiphil
Jan 9 '14 at 19:57




Reading a long output (as in git diff or git log) in less -X will take up the scroll buffer in my terminal and evict much of the previous output. I'd love it if less could just exit with the last screenful of output at the time of the exit; i.e. no more than one page of the scroll buffer would be taken after quitting less. Any ideas?
– musiphil
Jan 9 '14 at 19:57












By the way, -R is usually a safer choice than -r.
– musiphil
Jan 9 '14 at 20:14




By the way, -R is usually a safer choice than -r.
– musiphil
Jan 9 '14 at 20:14












Thanks. For those wondering: -R is "Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained correctly in most cases."
– Steve Bennett
Jan 13 '14 at 4:20




Thanks. For those wondering: -R is "Like -r, but only ANSI "color" escape sequences are output in "raw" form. Unlike -r, the screen appearance is maintained correctly in most cases."
– Steve Bennett
Jan 13 '14 at 4:20












@musiphil Perhaps -c?
– Vanessa Phipps
May 1 '14 at 16:46




@musiphil Perhaps -c?
– Vanessa Phipps
May 1 '14 at 16:46












@MatthewPhipps: I guess -c is about how to update the screen when you move around inside less.
– musiphil
May 1 '14 at 20:48




@MatthewPhipps: I guess -c is about how to update the screen when you move around inside less.
– musiphil
May 1 '14 at 20:48










3 Answers
3






active

oldest

votes

















up vote
65
down vote



accepted










This is actually a function of the terminal emulator you are using (xterm, gnome-terminal, konsole, screen). An alternate screen, or altscreen, gets launched when programs such as less or vim are invoked. This altscreen has no history buffer and exits immediately when you quit the program, switching back to the original screen which restores the previous window content history and placement.



You can prevent less from launch in an altscreen by passing the argument "-X".



less -X /path/to/some/file



You can also pass "-X" as an environment variable. So if you are using bash, place this in ~/.bashrc:



export LESS="-X"


However, this disbles the termcap (terminal capability) initialization and deinitialization, so other views when you use less may appear off.



Another option would be to use screen and set the option altscreen off in your ~/.screenrc. less will not clear the screen and should preserve color formatting. Presumably tmux will have the same option.



This blog entry describes the problem and offers some different solutions specific to gnome-terminal with varying success.






share|improve this answer


















  • 2




    Perfect. Is there a downside?
    – Steve Bennett
    May 14 '12 at 13:46






  • 2




    Wait, I've discovered one already - the output of git log (and probably other coloured commands) is messed up.
    – Steve Bennett
    May 14 '12 at 13:49






  • 1




    @SteveBennett That's small enough I'd make it an alias: alias les="/usr/bin/less -X"
    – bonsaiviking
    May 14 '12 at 14:33






  • 3




    Hey, I think I just discovered an antidote to the git log issue above: export LESS="-r -X". (No idea what the side-effects of that are...)
    – Steve Bennett
    May 14 '12 at 14:43






  • 5




    Actually, git sets the LESS variable to FRSX if it is unset when it runs the pager, so you can just leave LESS unset and less will automatically run with -FRSX. Look for core.pager in git-config(1) for more information.
    – musiphil
    Jan 9 '14 at 19:51

















up vote
1
down vote













George's solution didn't work for me, but this solution did (from the blog entry linked in his answer).



  1. $ infocmp -I xterm > ~/xterm-noclear.src



  2. Edit ~/xterm-noclear.src



    • change the name on the second line from 'xterm' to 'xterm-noclear', or whatever suits you (also change 'xterm-debian' if it's present)


    • remove the instructions 'smcup' and 'rmcup' (e.g. "smcup=E[?1049h, " and "rmcup=E[?1049l, ")



  3. $ mkdir ~/.terminfo


  4. $ tic ~/xterm-noclear.src (x/xterm-noclear should appear in your ~/.terminfo directory)


  5. $ export TERM=xterm-noclear (now check the behaviour of less and, if satisfied, add the export directive line to your ~/.profile)


(I copied these instructions directly from @jah's rejected edit of George's answer.)






share|improve this answer



























    up vote
    1
    down vote













    The way I remember this is less -SEX for when I need to dump output to the screen but don't want lines to wrap. For example docker ps | less -SEX What that does is this:




    • -S

      • Scroll instead of wrap

      • If you drop the -E, you can use your arrow keys to scroll



    • -E

      • Exit when you reach the EOF



    • -X

      • Prevent term swapping/blanking

      • The "memory" part is that I know what S and E does, so this must be the other part. (And our reason for committing this command to memory is that we want to dump (not enter an interactive session) unwrapped output.


    I hope that helps. If you can't remember less -SEX, there's not a lot of hope for you. Just re-google every time I guess.






    share|improve this answer




















      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f38634%2fis-there-any-way-to-exit-less-without-clearing-the-screen%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      65
      down vote



      accepted










      This is actually a function of the terminal emulator you are using (xterm, gnome-terminal, konsole, screen). An alternate screen, or altscreen, gets launched when programs such as less or vim are invoked. This altscreen has no history buffer and exits immediately when you quit the program, switching back to the original screen which restores the previous window content history and placement.



      You can prevent less from launch in an altscreen by passing the argument "-X".



      less -X /path/to/some/file



      You can also pass "-X" as an environment variable. So if you are using bash, place this in ~/.bashrc:



      export LESS="-X"


      However, this disbles the termcap (terminal capability) initialization and deinitialization, so other views when you use less may appear off.



      Another option would be to use screen and set the option altscreen off in your ~/.screenrc. less will not clear the screen and should preserve color formatting. Presumably tmux will have the same option.



      This blog entry describes the problem and offers some different solutions specific to gnome-terminal with varying success.






      share|improve this answer


















      • 2




        Perfect. Is there a downside?
        – Steve Bennett
        May 14 '12 at 13:46






      • 2




        Wait, I've discovered one already - the output of git log (and probably other coloured commands) is messed up.
        – Steve Bennett
        May 14 '12 at 13:49






      • 1




        @SteveBennett That's small enough I'd make it an alias: alias les="/usr/bin/less -X"
        – bonsaiviking
        May 14 '12 at 14:33






      • 3




        Hey, I think I just discovered an antidote to the git log issue above: export LESS="-r -X". (No idea what the side-effects of that are...)
        – Steve Bennett
        May 14 '12 at 14:43






      • 5




        Actually, git sets the LESS variable to FRSX if it is unset when it runs the pager, so you can just leave LESS unset and less will automatically run with -FRSX. Look for core.pager in git-config(1) for more information.
        – musiphil
        Jan 9 '14 at 19:51














      up vote
      65
      down vote



      accepted










      This is actually a function of the terminal emulator you are using (xterm, gnome-terminal, konsole, screen). An alternate screen, or altscreen, gets launched when programs such as less or vim are invoked. This altscreen has no history buffer and exits immediately when you quit the program, switching back to the original screen which restores the previous window content history and placement.



      You can prevent less from launch in an altscreen by passing the argument "-X".



      less -X /path/to/some/file



      You can also pass "-X" as an environment variable. So if you are using bash, place this in ~/.bashrc:



      export LESS="-X"


      However, this disbles the termcap (terminal capability) initialization and deinitialization, so other views when you use less may appear off.



      Another option would be to use screen and set the option altscreen off in your ~/.screenrc. less will not clear the screen and should preserve color formatting. Presumably tmux will have the same option.



      This blog entry describes the problem and offers some different solutions specific to gnome-terminal with varying success.






      share|improve this answer


















      • 2




        Perfect. Is there a downside?
        – Steve Bennett
        May 14 '12 at 13:46






      • 2




        Wait, I've discovered one already - the output of git log (and probably other coloured commands) is messed up.
        – Steve Bennett
        May 14 '12 at 13:49






      • 1




        @SteveBennett That's small enough I'd make it an alias: alias les="/usr/bin/less -X"
        – bonsaiviking
        May 14 '12 at 14:33






      • 3




        Hey, I think I just discovered an antidote to the git log issue above: export LESS="-r -X". (No idea what the side-effects of that are...)
        – Steve Bennett
        May 14 '12 at 14:43






      • 5




        Actually, git sets the LESS variable to FRSX if it is unset when it runs the pager, so you can just leave LESS unset and less will automatically run with -FRSX. Look for core.pager in git-config(1) for more information.
        – musiphil
        Jan 9 '14 at 19:51












      up vote
      65
      down vote



      accepted







      up vote
      65
      down vote



      accepted






      This is actually a function of the terminal emulator you are using (xterm, gnome-terminal, konsole, screen). An alternate screen, or altscreen, gets launched when programs such as less or vim are invoked. This altscreen has no history buffer and exits immediately when you quit the program, switching back to the original screen which restores the previous window content history and placement.



      You can prevent less from launch in an altscreen by passing the argument "-X".



      less -X /path/to/some/file



      You can also pass "-X" as an environment variable. So if you are using bash, place this in ~/.bashrc:



      export LESS="-X"


      However, this disbles the termcap (terminal capability) initialization and deinitialization, so other views when you use less may appear off.



      Another option would be to use screen and set the option altscreen off in your ~/.screenrc. less will not clear the screen and should preserve color formatting. Presumably tmux will have the same option.



      This blog entry describes the problem and offers some different solutions specific to gnome-terminal with varying success.






      share|improve this answer














      This is actually a function of the terminal emulator you are using (xterm, gnome-terminal, konsole, screen). An alternate screen, or altscreen, gets launched when programs such as less or vim are invoked. This altscreen has no history buffer and exits immediately when you quit the program, switching back to the original screen which restores the previous window content history and placement.



      You can prevent less from launch in an altscreen by passing the argument "-X".



      less -X /path/to/some/file



      You can also pass "-X" as an environment variable. So if you are using bash, place this in ~/.bashrc:



      export LESS="-X"


      However, this disbles the termcap (terminal capability) initialization and deinitialization, so other views when you use less may appear off.



      Another option would be to use screen and set the option altscreen off in your ~/.screenrc. less will not clear the screen and should preserve color formatting. Presumably tmux will have the same option.



      This blog entry describes the problem and offers some different solutions specific to gnome-terminal with varying success.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Aug 30 '17 at 16:58

























      answered May 14 '12 at 13:44









      George M

      8,94623247




      8,94623247







      • 2




        Perfect. Is there a downside?
        – Steve Bennett
        May 14 '12 at 13:46






      • 2




        Wait, I've discovered one already - the output of git log (and probably other coloured commands) is messed up.
        – Steve Bennett
        May 14 '12 at 13:49






      • 1




        @SteveBennett That's small enough I'd make it an alias: alias les="/usr/bin/less -X"
        – bonsaiviking
        May 14 '12 at 14:33






      • 3




        Hey, I think I just discovered an antidote to the git log issue above: export LESS="-r -X". (No idea what the side-effects of that are...)
        – Steve Bennett
        May 14 '12 at 14:43






      • 5




        Actually, git sets the LESS variable to FRSX if it is unset when it runs the pager, so you can just leave LESS unset and less will automatically run with -FRSX. Look for core.pager in git-config(1) for more information.
        – musiphil
        Jan 9 '14 at 19:51












      • 2




        Perfect. Is there a downside?
        – Steve Bennett
        May 14 '12 at 13:46






      • 2




        Wait, I've discovered one already - the output of git log (and probably other coloured commands) is messed up.
        – Steve Bennett
        May 14 '12 at 13:49






      • 1




        @SteveBennett That's small enough I'd make it an alias: alias les="/usr/bin/less -X"
        – bonsaiviking
        May 14 '12 at 14:33






      • 3




        Hey, I think I just discovered an antidote to the git log issue above: export LESS="-r -X". (No idea what the side-effects of that are...)
        – Steve Bennett
        May 14 '12 at 14:43






      • 5




        Actually, git sets the LESS variable to FRSX if it is unset when it runs the pager, so you can just leave LESS unset and less will automatically run with -FRSX. Look for core.pager in git-config(1) for more information.
        – musiphil
        Jan 9 '14 at 19:51







      2




      2




      Perfect. Is there a downside?
      – Steve Bennett
      May 14 '12 at 13:46




      Perfect. Is there a downside?
      – Steve Bennett
      May 14 '12 at 13:46




      2




      2




      Wait, I've discovered one already - the output of git log (and probably other coloured commands) is messed up.
      – Steve Bennett
      May 14 '12 at 13:49




      Wait, I've discovered one already - the output of git log (and probably other coloured commands) is messed up.
      – Steve Bennett
      May 14 '12 at 13:49




      1




      1




      @SteveBennett That's small enough I'd make it an alias: alias les="/usr/bin/less -X"
      – bonsaiviking
      May 14 '12 at 14:33




      @SteveBennett That's small enough I'd make it an alias: alias les="/usr/bin/less -X"
      – bonsaiviking
      May 14 '12 at 14:33




      3




      3




      Hey, I think I just discovered an antidote to the git log issue above: export LESS="-r -X". (No idea what the side-effects of that are...)
      – Steve Bennett
      May 14 '12 at 14:43




      Hey, I think I just discovered an antidote to the git log issue above: export LESS="-r -X". (No idea what the side-effects of that are...)
      – Steve Bennett
      May 14 '12 at 14:43




      5




      5




      Actually, git sets the LESS variable to FRSX if it is unset when it runs the pager, so you can just leave LESS unset and less will automatically run with -FRSX. Look for core.pager in git-config(1) for more information.
      – musiphil
      Jan 9 '14 at 19:51




      Actually, git sets the LESS variable to FRSX if it is unset when it runs the pager, so you can just leave LESS unset and less will automatically run with -FRSX. Look for core.pager in git-config(1) for more information.
      – musiphil
      Jan 9 '14 at 19:51












      up vote
      1
      down vote













      George's solution didn't work for me, but this solution did (from the blog entry linked in his answer).



      1. $ infocmp -I xterm > ~/xterm-noclear.src



      2. Edit ~/xterm-noclear.src



        • change the name on the second line from 'xterm' to 'xterm-noclear', or whatever suits you (also change 'xterm-debian' if it's present)


        • remove the instructions 'smcup' and 'rmcup' (e.g. "smcup=E[?1049h, " and "rmcup=E[?1049l, ")



      3. $ mkdir ~/.terminfo


      4. $ tic ~/xterm-noclear.src (x/xterm-noclear should appear in your ~/.terminfo directory)


      5. $ export TERM=xterm-noclear (now check the behaviour of less and, if satisfied, add the export directive line to your ~/.profile)


      (I copied these instructions directly from @jah's rejected edit of George's answer.)






      share|improve this answer
























        up vote
        1
        down vote













        George's solution didn't work for me, but this solution did (from the blog entry linked in his answer).



        1. $ infocmp -I xterm > ~/xterm-noclear.src



        2. Edit ~/xterm-noclear.src



          • change the name on the second line from 'xterm' to 'xterm-noclear', or whatever suits you (also change 'xterm-debian' if it's present)


          • remove the instructions 'smcup' and 'rmcup' (e.g. "smcup=E[?1049h, " and "rmcup=E[?1049l, ")



        3. $ mkdir ~/.terminfo


        4. $ tic ~/xterm-noclear.src (x/xterm-noclear should appear in your ~/.terminfo directory)


        5. $ export TERM=xterm-noclear (now check the behaviour of less and, if satisfied, add the export directive line to your ~/.profile)


        (I copied these instructions directly from @jah's rejected edit of George's answer.)






        share|improve this answer






















          up vote
          1
          down vote










          up vote
          1
          down vote









          George's solution didn't work for me, but this solution did (from the blog entry linked in his answer).



          1. $ infocmp -I xterm > ~/xterm-noclear.src



          2. Edit ~/xterm-noclear.src



            • change the name on the second line from 'xterm' to 'xterm-noclear', or whatever suits you (also change 'xterm-debian' if it's present)


            • remove the instructions 'smcup' and 'rmcup' (e.g. "smcup=E[?1049h, " and "rmcup=E[?1049l, ")



          3. $ mkdir ~/.terminfo


          4. $ tic ~/xterm-noclear.src (x/xterm-noclear should appear in your ~/.terminfo directory)


          5. $ export TERM=xterm-noclear (now check the behaviour of less and, if satisfied, add the export directive line to your ~/.profile)


          (I copied these instructions directly from @jah's rejected edit of George's answer.)






          share|improve this answer












          George's solution didn't work for me, but this solution did (from the blog entry linked in his answer).



          1. $ infocmp -I xterm > ~/xterm-noclear.src



          2. Edit ~/xterm-noclear.src



            • change the name on the second line from 'xterm' to 'xterm-noclear', or whatever suits you (also change 'xterm-debian' if it's present)


            • remove the instructions 'smcup' and 'rmcup' (e.g. "smcup=E[?1049h, " and "rmcup=E[?1049l, ")



          3. $ mkdir ~/.terminfo


          4. $ tic ~/xterm-noclear.src (x/xterm-noclear should appear in your ~/.terminfo directory)


          5. $ export TERM=xterm-noclear (now check the behaviour of less and, if satisfied, add the export directive line to your ~/.profile)


          (I copied these instructions directly from @jah's rejected edit of George's answer.)







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 28 '17 at 2:57









          prl

          1112




          1112




















              up vote
              1
              down vote













              The way I remember this is less -SEX for when I need to dump output to the screen but don't want lines to wrap. For example docker ps | less -SEX What that does is this:




              • -S

                • Scroll instead of wrap

                • If you drop the -E, you can use your arrow keys to scroll



              • -E

                • Exit when you reach the EOF



              • -X

                • Prevent term swapping/blanking

                • The "memory" part is that I know what S and E does, so this must be the other part. (And our reason for committing this command to memory is that we want to dump (not enter an interactive session) unwrapped output.


              I hope that helps. If you can't remember less -SEX, there's not a lot of hope for you. Just re-google every time I guess.






              share|improve this answer
























                up vote
                1
                down vote













                The way I remember this is less -SEX for when I need to dump output to the screen but don't want lines to wrap. For example docker ps | less -SEX What that does is this:




                • -S

                  • Scroll instead of wrap

                  • If you drop the -E, you can use your arrow keys to scroll



                • -E

                  • Exit when you reach the EOF



                • -X

                  • Prevent term swapping/blanking

                  • The "memory" part is that I know what S and E does, so this must be the other part. (And our reason for committing this command to memory is that we want to dump (not enter an interactive session) unwrapped output.


                I hope that helps. If you can't remember less -SEX, there's not a lot of hope for you. Just re-google every time I guess.






                share|improve this answer






















                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  The way I remember this is less -SEX for when I need to dump output to the screen but don't want lines to wrap. For example docker ps | less -SEX What that does is this:




                  • -S

                    • Scroll instead of wrap

                    • If you drop the -E, you can use your arrow keys to scroll



                  • -E

                    • Exit when you reach the EOF



                  • -X

                    • Prevent term swapping/blanking

                    • The "memory" part is that I know what S and E does, so this must be the other part. (And our reason for committing this command to memory is that we want to dump (not enter an interactive session) unwrapped output.


                  I hope that helps. If you can't remember less -SEX, there's not a lot of hope for you. Just re-google every time I guess.






                  share|improve this answer












                  The way I remember this is less -SEX for when I need to dump output to the screen but don't want lines to wrap. For example docker ps | less -SEX What that does is this:




                  • -S

                    • Scroll instead of wrap

                    • If you drop the -E, you can use your arrow keys to scroll



                  • -E

                    • Exit when you reach the EOF



                  • -X

                    • Prevent term swapping/blanking

                    • The "memory" part is that I know what S and E does, so this must be the other part. (And our reason for committing this command to memory is that we want to dump (not enter an interactive session) unwrapped output.


                  I hope that helps. If you can't remember less -SEX, there's not a lot of hope for you. Just re-google every time I guess.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered yesterday









                  Bruno Bronosky

                  1,86511112




                  1,86511112



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f38634%2fis-there-any-way-to-exit-less-without-clearing-the-screen%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown






                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Bahrain

                      Postfix configuration issue with fips on centos 7; mailgun relay