Forrest logo
back to the inotifywait tool

inotifywait:tldr:2e033

inotifywait: Watch a directory for changes, excluding files, whose names match a regular expression.
$ inotifywait --monitor --recursive --exclude "${regular_expression}" ${path-to-directory}
try on your machine

The inotifywait command is a Linux utility that allows monitoring file system events, such as file or directory creation, modification, or deletion.

The command you provided has the following options and arguments:

  • --monitor: Tells inotifywait to continuously monitor the specified directory for file system events.
  • --recursive: Specifies that the monitoring should be done recursively, meaning it will include subdirectories.
  • --exclude "${regular_expression}": Defines a regular expression pattern to exclude certain files or directories from being monitored. You should replace ${regular_expression} with the specific regular expression pattern you want to use to exclude specific files or directories.
  • ${path-to-directory}: Specifies the directory path that you want to monitor.

By running this command, you can monitor file system events in the specified directory and its subdirectories, excluding any files or directories that match the provided regular expression pattern.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the inotifywait tool