inotifywatch
monitoringLinux
The inotifywatch command is one of the most frequently used commands in Linux/Unix-like operating systems. inotifywatch Gather filesystem access statistics using inotify
Quick Reference
Command Name:
inotifywatch
Category:
monitoring
Platform:
Linux
Basic Usage:
inotifywatch [options] [arguments]
Common Use Cases
Syntax
inotifywatch [options] [file/directory...]
Options
Option | Description |
---|---|
-r, --recursive |
Watch directories recursively |
-e, --event EVENT |
Watch for specific event(s) only (access, modify, attrib, close_write, close_nowrite, close, open, moved_to, moved_from, move, move_self, create, delete, delete_self, unmount) |
--exclude PATTERN |
Exclude files matching this regular expression |
--excludei PATTERN |
Like --exclude but case insensitive |
--include PATTERN |
Include only files matching this regular expression |
--includei PATTERN |
Like --include but case insensitive |
-t, --timeout SECONDS |
Listen only for SECONDS seconds |
-s, --statistics |
Output statistics instead of normal output |
-a, --ascending |
Sort statistics by ascending order |
-d, --descending |
Sort statistics by descending order |
-z, --zero |
Include entries with zero events in statistics |
--fromfile FILENAME |
Read files to watch from FILENAME, one per line |
-h, --help |
Show help message |
-v, --verbose |
Be verbose |
--version |
Output version information and exit |
Examples
How to Use These Examples
The examples below show common ways to use the inotifywatch
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
inotifywatch -v -e access -e modify -t 60 /path/to/file