monitor files being accesssed

There is a great tool to identify files being access: inotifywait

steps

  1. make sure inotify package is installed
    sudo apt-get install inotify-tools
  2. simply run
    inotifywait -m -r --format '%:e %f' .

    all files being accessed will be displayed

Additional filtering and output formatting options are available, `man inotifywait` for more information.

Note that inotifywatch is also available, no monitor files for a given timeperiod.

examples

//1. listen to all events on all files (recursively) within current directory with output of type "EVENT_TYPE file_name"
inotifywait -m -r --format '%:e %f' . 
// 2. listen to event MODIFY (i.e. writing content) on all files (recursively) within current directory with output of type "EVENT_TYPE file_path"
inotifywait -m -r --format '%:e %w%f' -e MODIFY .

sources

Post a Comment

Your email is never published nor shared. You're allow to say what you want...