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:
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.
We can use the inotifywait command to monitor a directory tree. To monitor a directory tree, including its subdirectories, we'll use the -r parameter. Also, we have to use the -m parameter. This configures inotifywait to keep watching the directory forever.
Watching Files and Directories with Watchman in Linux To watch a directory (e.g ~/bin ) for changes, run the following command. The following command writes a configuration file called state under /usr/local/var/run/watchman/<username>-state/, in JSON format as well as a log file called log in the same location.
You need to subscribe to file system change notifications.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With