Is there a way to disable the delay of less +F?

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











up vote
1
down vote

favorite












Running less +F file is very convenient because you can switch in and out of forward-forever mode with Ctrl-C and ⇧-F respectively.



Unfortunately new lines appear with a delay, which is very irritating when you are watching and comparing with something else.



tail -f does not have this delay, but you can't easily switch out of forward-forever mode to scroll up or search or something.



Is there a way to combine the best of both?







share|improve this question
























    up vote
    1
    down vote

    favorite












    Running less +F file is very convenient because you can switch in and out of forward-forever mode with Ctrl-C and ⇧-F respectively.



    Unfortunately new lines appear with a delay, which is very irritating when you are watching and comparing with something else.



    tail -f does not have this delay, but you can't easily switch out of forward-forever mode to scroll up or search or something.



    Is there a way to combine the best of both?







    share|improve this question






















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      Running less +F file is very convenient because you can switch in and out of forward-forever mode with Ctrl-C and ⇧-F respectively.



      Unfortunately new lines appear with a delay, which is very irritating when you are watching and comparing with something else.



      tail -f does not have this delay, but you can't easily switch out of forward-forever mode to scroll up or search or something.



      Is there a way to combine the best of both?







      share|improve this question












      Running less +F file is very convenient because you can switch in and out of forward-forever mode with Ctrl-C and ⇧-F respectively.



      Unfortunately new lines appear with a delay, which is very irritating when you are watching and comparing with something else.



      tail -f does not have this delay, but you can't easily switch out of forward-forever mode to scroll up or search or something.



      Is there a way to combine the best of both?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 10 '17 at 10:10









      AndreKR

      304419




      304419




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          3
          down vote













          The reason you're experiencing a delay when using less +F is this (taken from this answer, which is so good I'll quote it verbatim):




          less +F reads the whole file, whereas on many systems tail -f only reads the end of the file, and even on the systems where it does read the whole file, at least it doesn't keep the whole file in memory. That makes less +F impractical for very large files. You can however run less -n +F, which causes less to read only the end of the file, at the cost of not displaying number.



          Under the hood, between less -n +F and tail -f does, the main difference is that tail uses a file change notification service on some platforms (e.g. inotify on Linux), which allows it to display new data instantly, whereas less might take up to 1 second to display the new data because it checks for new data in a loop and sleeps between checks.







          share|improve this answer




















          • Thanks, I assumed you could just block on a read and you would be scheduled when new data arrives, but apparently you need a file system event. With this knowledge I looked up the code in tail and sent an email to Mark Nudelman.
            – AndreKR
            Nov 10 '17 at 11:09










          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: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f403723%2fis-there-a-way-to-disable-the-delay-of-less-f%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          3
          down vote













          The reason you're experiencing a delay when using less +F is this (taken from this answer, which is so good I'll quote it verbatim):




          less +F reads the whole file, whereas on many systems tail -f only reads the end of the file, and even on the systems where it does read the whole file, at least it doesn't keep the whole file in memory. That makes less +F impractical for very large files. You can however run less -n +F, which causes less to read only the end of the file, at the cost of not displaying number.



          Under the hood, between less -n +F and tail -f does, the main difference is that tail uses a file change notification service on some platforms (e.g. inotify on Linux), which allows it to display new data instantly, whereas less might take up to 1 second to display the new data because it checks for new data in a loop and sleeps between checks.







          share|improve this answer




















          • Thanks, I assumed you could just block on a read and you would be scheduled when new data arrives, but apparently you need a file system event. With this knowledge I looked up the code in tail and sent an email to Mark Nudelman.
            – AndreKR
            Nov 10 '17 at 11:09














          up vote
          3
          down vote













          The reason you're experiencing a delay when using less +F is this (taken from this answer, which is so good I'll quote it verbatim):




          less +F reads the whole file, whereas on many systems tail -f only reads the end of the file, and even on the systems where it does read the whole file, at least it doesn't keep the whole file in memory. That makes less +F impractical for very large files. You can however run less -n +F, which causes less to read only the end of the file, at the cost of not displaying number.



          Under the hood, between less -n +F and tail -f does, the main difference is that tail uses a file change notification service on some platforms (e.g. inotify on Linux), which allows it to display new data instantly, whereas less might take up to 1 second to display the new data because it checks for new data in a loop and sleeps between checks.







          share|improve this answer




















          • Thanks, I assumed you could just block on a read and you would be scheduled when new data arrives, but apparently you need a file system event. With this knowledge I looked up the code in tail and sent an email to Mark Nudelman.
            – AndreKR
            Nov 10 '17 at 11:09












          up vote
          3
          down vote










          up vote
          3
          down vote









          The reason you're experiencing a delay when using less +F is this (taken from this answer, which is so good I'll quote it verbatim):




          less +F reads the whole file, whereas on many systems tail -f only reads the end of the file, and even on the systems where it does read the whole file, at least it doesn't keep the whole file in memory. That makes less +F impractical for very large files. You can however run less -n +F, which causes less to read only the end of the file, at the cost of not displaying number.



          Under the hood, between less -n +F and tail -f does, the main difference is that tail uses a file change notification service on some platforms (e.g. inotify on Linux), which allows it to display new data instantly, whereas less might take up to 1 second to display the new data because it checks for new data in a loop and sleeps between checks.







          share|improve this answer












          The reason you're experiencing a delay when using less +F is this (taken from this answer, which is so good I'll quote it verbatim):




          less +F reads the whole file, whereas on many systems tail -f only reads the end of the file, and even on the systems where it does read the whole file, at least it doesn't keep the whole file in memory. That makes less +F impractical for very large files. You can however run less -n +F, which causes less to read only the end of the file, at the cost of not displaying number.



          Under the hood, between less -n +F and tail -f does, the main difference is that tail uses a file change notification service on some platforms (e.g. inotify on Linux), which allows it to display new data instantly, whereas less might take up to 1 second to display the new data because it checks for new data in a loop and sleeps between checks.








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 10 '17 at 10:23









          dr01

          15.3k114769




          15.3k114769











          • Thanks, I assumed you could just block on a read and you would be scheduled when new data arrives, but apparently you need a file system event. With this knowledge I looked up the code in tail and sent an email to Mark Nudelman.
            – AndreKR
            Nov 10 '17 at 11:09
















          • Thanks, I assumed you could just block on a read and you would be scheduled when new data arrives, but apparently you need a file system event. With this knowledge I looked up the code in tail and sent an email to Mark Nudelman.
            – AndreKR
            Nov 10 '17 at 11:09















          Thanks, I assumed you could just block on a read and you would be scheduled when new data arrives, but apparently you need a file system event. With this knowledge I looked up the code in tail and sent an email to Mark Nudelman.
          – AndreKR
          Nov 10 '17 at 11:09




          Thanks, I assumed you could just block on a read and you would be scheduled when new data arrives, but apparently you need a file system event. With this knowledge I looked up the code in tail and sent an email to Mark Nudelman.
          – AndreKR
          Nov 10 '17 at 11:09

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403723%2fis-there-a-way-to-disable-the-delay-of-less-f%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

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

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?