Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am sure this is a simple question but i just cannot figure it out. List all files that (in any way) trigger an event defined in inotifywait.

My command is: inotifywait -m -c -r $PWD > /tmp/file.csv

Problem: When monitoring $PWD and starting a process that accesses this directory I get redundant information that files are accessed. It would be sufficient to know that a file was accessed once (no for each occurrence).

Michael

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I don't think there is any way to get inotifywait to do this - it would be be tricky because either the kernel or inotifywait itself would have to remember all the files that had previously been reported in order to avoid issuing extra events.

You will probably need to post-process the log, with sort -u or something, to remove the duplicate events that you are not interested in.

share|improve this answer
    
I have found this very fast solution for post-processing link –  Michael Nov 6 '12 at 9:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.