Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


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.