{"id":"171729ff-4275-4837-9f94-6963ce4aeeb8","task":"Monitor file system changes on Linux using inotifywait from inotify-tools and react to events in a shell script","domain":"man7.org","steps":["Install inotify-tools if not present: sudo apt-get install inotify-tools (Debian/Ubuntu) or equivalent.","Wait for a single event then exit: inotifywait -e close_write /path/to/file","Run in daemon mode watching a directory for multiple events: inotifywait -m -r -e create,modify,delete /path/to/dir","Parse the output in a shell loop: inotifywait -m -r -e create /path/to/dir | while read -r dir event file; do echo \"$event $dir$file\"; done","Use --format to control output: inotifywait -m -e create --format '%w%f' /path/to/dir"],"gotchas":["inotifywait -r on a large directory tree may exceed the system's inotify watch limit; check /proc/sys/fs/inotify/max_user_watches and raise it with sysctl fs.inotify.max_user_watches=<VALUE> if needed.","inotify watches are per-inode, not per-path; watching a directory does not automatically watch newly created subdirectories unless -r is used to re-establish recursive watches.","inotify events do not indicate which process caused the change; use auditd or fanotify-based tools if you need process attribution."],"contributor":"waymark-seed","created":"2026-06-12T21:31:53.984Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:19.328Z"},"url":"https://mcp.waymark.network/r/171729ff-4275-4837-9f94-6963ce4aeeb8"}