Command for reloading file from disk to show changes when using “less?”












2















In less is there a command for reloading a file from disk, so that less will show any changes made to a file since less was started? This would saving me have to terminate and restart less if I want to see changes to the file I'm viewing.










share|improve this question

























  • So you mean instead of following data appended to a file using something like tail -f -n 200 some_file.txt you would want less to reload the file but only show changed content that could be anywhere in the file? Beginning middle or end?

    – JakeGould
    Jul 21 '17 at 15:23
















2















In less is there a command for reloading a file from disk, so that less will show any changes made to a file since less was started? This would saving me have to terminate and restart less if I want to see changes to the file I'm viewing.










share|improve this question

























  • So you mean instead of following data appended to a file using something like tail -f -n 200 some_file.txt you would want less to reload the file but only show changed content that could be anywhere in the file? Beginning middle or end?

    – JakeGould
    Jul 21 '17 at 15:23














2












2








2


1






In less is there a command for reloading a file from disk, so that less will show any changes made to a file since less was started? This would saving me have to terminate and restart less if I want to see changes to the file I'm viewing.










share|improve this question
















In less is there a command for reloading a file from disk, so that less will show any changes made to a file since less was started? This would saving me have to terminate and restart less if I want to see changes to the file I'm viewing.







command-line unix less






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 21 '17 at 15:21









JakeGould

32k1098140




32k1098140










asked Jul 21 '17 at 15:17









Dan StevensDan Stevens

151410




151410













  • So you mean instead of following data appended to a file using something like tail -f -n 200 some_file.txt you would want less to reload the file but only show changed content that could be anywhere in the file? Beginning middle or end?

    – JakeGould
    Jul 21 '17 at 15:23



















  • So you mean instead of following data appended to a file using something like tail -f -n 200 some_file.txt you would want less to reload the file but only show changed content that could be anywhere in the file? Beginning middle or end?

    – JakeGould
    Jul 21 '17 at 15:23

















So you mean instead of following data appended to a file using something like tail -f -n 200 some_file.txt you would want less to reload the file but only show changed content that could be anywhere in the file? Beginning middle or end?

– JakeGould
Jul 21 '17 at 15:23





So you mean instead of following data appended to a file using something like tail -f -n 200 some_file.txt you would want less to reload the file but only show changed content that could be anywhere in the file? Beginning middle or end?

– JakeGould
Jul 21 '17 at 15:23










2 Answers
2






active

oldest

votes


















2














There are two possibly relevant commands detailed in the fine manual for less(1)



   R      Repaint the screen, discarding any buffered  input.   Useful  if
the file is changing while it is being viewed.

F Scroll forward, and keep trying to read when the end of file is
reached. Normally this command would be used when already at
the end of the file. It is a way to monitor the tail of a file
which is growing while it is being viewed. (The behavior is
similar to the "tail -f" command.)





share|improve this answer































    0














    R for repaint does reload the file on Linux, but does not work for Mac.



    A workaround for Mac is to press hq, which will open the Help page, then quit. It has a side effect of reloading the file.






    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      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',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      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%2fsuperuser.com%2fquestions%2f1232125%2fcommand-for-reloading-file-from-disk-to-show-changes-when-using-less%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      There are two possibly relevant commands detailed in the fine manual for less(1)



         R      Repaint the screen, discarding any buffered  input.   Useful  if
      the file is changing while it is being viewed.

      F Scroll forward, and keep trying to read when the end of file is
      reached. Normally this command would be used when already at
      the end of the file. It is a way to monitor the tail of a file
      which is growing while it is being viewed. (The behavior is
      similar to the "tail -f" command.)





      share|improve this answer




























        2














        There are two possibly relevant commands detailed in the fine manual for less(1)



           R      Repaint the screen, discarding any buffered  input.   Useful  if
        the file is changing while it is being viewed.

        F Scroll forward, and keep trying to read when the end of file is
        reached. Normally this command would be used when already at
        the end of the file. It is a way to monitor the tail of a file
        which is growing while it is being viewed. (The behavior is
        similar to the "tail -f" command.)





        share|improve this answer


























          2












          2








          2







          There are two possibly relevant commands detailed in the fine manual for less(1)



             R      Repaint the screen, discarding any buffered  input.   Useful  if
          the file is changing while it is being viewed.

          F Scroll forward, and keep trying to read when the end of file is
          reached. Normally this command would be used when already at
          the end of the file. It is a way to monitor the tail of a file
          which is growing while it is being viewed. (The behavior is
          similar to the "tail -f" command.)





          share|improve this answer













          There are two possibly relevant commands detailed in the fine manual for less(1)



             R      Repaint the screen, discarding any buffered  input.   Useful  if
          the file is changing while it is being viewed.

          F Scroll forward, and keep trying to read when the end of file is
          reached. Normally this command would be used when already at
          the end of the file. It is a way to monitor the tail of a file
          which is growing while it is being viewed. (The behavior is
          similar to the "tail -f" command.)






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 21 '17 at 15:39









          thrigthrig

          63646




          63646

























              0














              R for repaint does reload the file on Linux, but does not work for Mac.



              A workaround for Mac is to press hq, which will open the Help page, then quit. It has a side effect of reloading the file.






              share|improve this answer




























                0














                R for repaint does reload the file on Linux, but does not work for Mac.



                A workaround for Mac is to press hq, which will open the Help page, then quit. It has a side effect of reloading the file.






                share|improve this answer


























                  0












                  0








                  0







                  R for repaint does reload the file on Linux, but does not work for Mac.



                  A workaround for Mac is to press hq, which will open the Help page, then quit. It has a side effect of reloading the file.






                  share|improve this answer













                  R for repaint does reload the file on Linux, but does not work for Mac.



                  A workaround for Mac is to press hq, which will open the Help page, then quit. It has a side effect of reloading the file.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered May 23 '18 at 21:12









                  wisbuckywisbucky

                  1,1051018




                  1,1051018






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1232125%2fcommand-for-reloading-file-from-disk-to-show-changes-when-using-less%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

                      Paul Cézanne

                      UIScrollView CustomStickyHeader Resize height generates problems when scroll is too fast

                      Angular material date-picker (MatDatepicker) auto completes the date on focus out