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 would like to make a log of all newly created files and/or folders under a particular directory. I'm trying to monitor what files are being moved to and copied from a directory on OSX Mountain Lion 10.8.3

share|improve this question

1 Answer 1

watch -d highlights added and removed lines for 2 seconds:

watch -d ls

-d=--cumulative shows the highlights permanently:

watch -d=--cumulative ls

Or add a line like this to crontab:

* * * * * ls ~/Desktop/ > /tmp/desktop-$(date +\%Y\%m\%d\%H\%M\%S)

And then compare the files:

$ diff -y /tmp/desktop-20130604105700 /tmp/desktop-20130604105800
file1                               file1
                                  > file2
$ comm -13 /tmp/desktop-20130604105700 /tmp/desktop-20130604105800
file2
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.