Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm working on a project trying to auto-bookmark folders based on how frequently a folder/directory is visited. I have searched exhaustively as to how to monitor folders visited by the current user. Can anyone guide me as to how to construct a script for doing the same?

Language restrictions : C or Java. Maybe python.

share|improve this question

1 Answer 1

Install inotify-tools and you can play around with inotifywatch and inotifywait. The first logs all activity, the second breaks on certain activity. Both work well but obviously which you want depends on what you're doing.

A simple bash to show the first operation inside a directory is:

$ inotifywait -r .
./path/to/ OPEN file.ext

Note if it's a big dir, setting up all the listeners takes a while.

For better scripting access, look at pyinotify or just look at the C headers for inotify-tools.

share|improve this answer

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.