Options (5)
-m, --monitorbooleanContinuously watch a specific file for events without exiting
Example:
inotifywait {{[-m|--monitor]}} {{path/to/file}}-r, --recursivebooleanWatch a directory recursively for events
Example:
inotifywait {{[-m|--monitor]}} {{[-r|--recursive]}} {{path/to/directory}}-t, --timeoutbooleanWatch a file for changes, exiting when no event occurs for 30 seconds
Example:
inotifywait {{[-m|--monitor]}} {{[-t|--timeout]}} {{30}} {{path/to/file}}-e, --eventbooleanOnly watch a file for file modification events
Example:
inotifywait {{[-e|--event]}} {{modify}} {{path/to/file}}-q, --quietbooleanWatch a file printing only events, and no status messages
Example:
inotifywait {{[-q|--quiet]}} {{path/to/file}}Examples (8)
Watch a specific file for events, exiting after the first one
inotifywait path/to/fileContinuously watch a specific file for events without exiting
inotifywait [-m|--monitor] path/to/fileWatch a directory recursively for events
inotifywait [-m|--monitor] [-r|--recursive] path/to/directoryWatch a directory for changes, excluding files, whose names match a `regex`
inotifywait [-m|--monitor] [-r|--recursive] --exclude "regex" path/to/directoryWatch a file for changes, exiting when no event occurs for 30 seconds
inotifywait [-m|--monitor] [-t|--timeout] 30 path/to/fileOnly watch a file for file modification events
inotifywait [-e|--event] modify path/to/fileWatch a file printing only events, and no status messages
inotifywait [-q|--quiet] path/to/fileRun a command when a file is accessed
inotifywait [-e|--event] access path/to/file && commandmade by @shridhargupta | data from tldr-pages