File access count in Linux










6















Is there a way how to effectively determine the number of accesses to a specific file and the process which accessed it without storing the access info by a 3rd party software? I'm looking for something built in inside the linux-based operating systems. The date of the last change is pretty obvious but I need information at least on how many times it was accessed since the creation of the file.



Can anyone shed some light on this file accessing information? Is it stored somewhere?










share|improve this question




























    6















    Is there a way how to effectively determine the number of accesses to a specific file and the process which accessed it without storing the access info by a 3rd party software? I'm looking for something built in inside the linux-based operating systems. The date of the last change is pretty obvious but I need information at least on how many times it was accessed since the creation of the file.



    Can anyone shed some light on this file accessing information? Is it stored somewhere?










    share|improve this question


























      6












      6








      6








      Is there a way how to effectively determine the number of accesses to a specific file and the process which accessed it without storing the access info by a 3rd party software? I'm looking for something built in inside the linux-based operating systems. The date of the last change is pretty obvious but I need information at least on how many times it was accessed since the creation of the file.



      Can anyone shed some light on this file accessing information? Is it stored somewhere?










      share|improve this question
















      Is there a way how to effectively determine the number of accesses to a specific file and the process which accessed it without storing the access info by a 3rd party software? I'm looking for something built in inside the linux-based operating systems. The date of the last change is pretty obvious but I need information at least on how many times it was accessed since the creation of the file.



      Can anyone shed some light on this file accessing information? Is it stored somewhere?







      linux file filesystems file-access






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jun 9 '13 at 14:01









      kirelagin

      9,91112944




      9,91112944










      asked Jun 9 '13 at 13:16









      DropoutDropout

      8,71193383




      8,71193383






















          1 Answer
          1






          active

          oldest

          votes


















          3














          No, it is not stored. That would be a very odd feature.



          You can monitor access to a file and count what you need yourself.



          • You can write your own program doing this with inotify. Here is a rather nice introduction.

          • Another option is using Linux audit subsystem. This way you'll set up rules telling the kernel which files are you interrested in, and later you'll be able to check logs to get whichever statistics you need. Here is a short tutorial.





          share|improve this answer























          • Thanks, I thought so, but I had to make sure :) I need to use it in a software I'm developing, so I'll probably implement this whole feature to it. Cheers!

            – Dropout
            Jun 9 '13 at 14:41











          • No new answers so far.. I'll designate this as an correct answer soon if nobody comes up with anything else, ok?

            – Dropout
            Jun 11 '13 at 8:34










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          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%2fstackoverflow.com%2fquestions%2f17009980%2ffile-access-count-in-linux%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          No, it is not stored. That would be a very odd feature.



          You can monitor access to a file and count what you need yourself.



          • You can write your own program doing this with inotify. Here is a rather nice introduction.

          • Another option is using Linux audit subsystem. This way you'll set up rules telling the kernel which files are you interrested in, and later you'll be able to check logs to get whichever statistics you need. Here is a short tutorial.





          share|improve this answer























          • Thanks, I thought so, but I had to make sure :) I need to use it in a software I'm developing, so I'll probably implement this whole feature to it. Cheers!

            – Dropout
            Jun 9 '13 at 14:41











          • No new answers so far.. I'll designate this as an correct answer soon if nobody comes up with anything else, ok?

            – Dropout
            Jun 11 '13 at 8:34















          3














          No, it is not stored. That would be a very odd feature.



          You can monitor access to a file and count what you need yourself.



          • You can write your own program doing this with inotify. Here is a rather nice introduction.

          • Another option is using Linux audit subsystem. This way you'll set up rules telling the kernel which files are you interrested in, and later you'll be able to check logs to get whichever statistics you need. Here is a short tutorial.





          share|improve this answer























          • Thanks, I thought so, but I had to make sure :) I need to use it in a software I'm developing, so I'll probably implement this whole feature to it. Cheers!

            – Dropout
            Jun 9 '13 at 14:41











          • No new answers so far.. I'll designate this as an correct answer soon if nobody comes up with anything else, ok?

            – Dropout
            Jun 11 '13 at 8:34













          3












          3








          3







          No, it is not stored. That would be a very odd feature.



          You can monitor access to a file and count what you need yourself.



          • You can write your own program doing this with inotify. Here is a rather nice introduction.

          • Another option is using Linux audit subsystem. This way you'll set up rules telling the kernel which files are you interrested in, and later you'll be able to check logs to get whichever statistics you need. Here is a short tutorial.





          share|improve this answer













          No, it is not stored. That would be a very odd feature.



          You can monitor access to a file and count what you need yourself.



          • You can write your own program doing this with inotify. Here is a rather nice introduction.

          • Another option is using Linux audit subsystem. This way you'll set up rules telling the kernel which files are you interrested in, and later you'll be able to check logs to get whichever statistics you need. Here is a short tutorial.






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jun 9 '13 at 14:09









          kirelaginkirelagin

          9,91112944




          9,91112944












          • Thanks, I thought so, but I had to make sure :) I need to use it in a software I'm developing, so I'll probably implement this whole feature to it. Cheers!

            – Dropout
            Jun 9 '13 at 14:41











          • No new answers so far.. I'll designate this as an correct answer soon if nobody comes up with anything else, ok?

            – Dropout
            Jun 11 '13 at 8:34

















          • Thanks, I thought so, but I had to make sure :) I need to use it in a software I'm developing, so I'll probably implement this whole feature to it. Cheers!

            – Dropout
            Jun 9 '13 at 14:41











          • No new answers so far.. I'll designate this as an correct answer soon if nobody comes up with anything else, ok?

            – Dropout
            Jun 11 '13 at 8:34
















          Thanks, I thought so, but I had to make sure :) I need to use it in a software I'm developing, so I'll probably implement this whole feature to it. Cheers!

          – Dropout
          Jun 9 '13 at 14:41





          Thanks, I thought so, but I had to make sure :) I need to use it in a software I'm developing, so I'll probably implement this whole feature to it. Cheers!

          – Dropout
          Jun 9 '13 at 14:41













          No new answers so far.. I'll designate this as an correct answer soon if nobody comes up with anything else, ok?

          – Dropout
          Jun 11 '13 at 8:34





          No new answers so far.. I'll designate this as an correct answer soon if nobody comes up with anything else, ok?

          – Dropout
          Jun 11 '13 at 8:34



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • 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%2fstackoverflow.com%2fquestions%2f17009980%2ffile-access-count-in-linux%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

          Kleinkühnau

          Makov (Slowakei)

          Deutsches Schauspielhaus