Detect directory changes in unix
bash, filesystems, linux, unix
Solution
You need to subscribe to file system change notifications.
Problem
How could I track changes of specific directory in UNIX? For example, I launch some utility which create some files during its execution. I want to know what exact files were created during one particular launch. Is there any simple way to get such information? Problem is that: - I cannot flush directory content after script execution - Files created with the name that has hash as a compound part. There is no possibility to get this hash from script for subsequent search. - There could be several scripts executed simultaneously, I do not want to see files created by another process in the same folder. Please notice that I do not want to know whether directory has been changed as stated here, I need filenames which ideally could be grepped to match specific pattern.