inotifywatch(1)
π
inotifywatch(1) + fsnotifywatch(1) β General Commands Manual, but make it make sense β¨
okay so this is the inotifywatch(1) / fsnotifywatch(1) page from General Commands Manual, and it is lowkey iconic for anyone who wants filesystem event receipts. no cap.
πΈ NAME
inotifywatch, fsnotifywatch β gather filesystem access statistics using inotify or fanotify.
π¦ SYNOPSIS
inotifywatch [-hvzrPqfIFS] [-e <event> ] [-t <seconds> ] [-a <event> ]
[-d <event> ] <file> [ ... ]
fsnotifywatch [-hvzrPqfIFS] [-e <event> ] [-t <seconds> ] [-a <event> ]
[-d <event> ] <file> [ ... ]
π DESCRIPTION
inotifywatch listens for filesystem events using Linux's inotify(7) interface by default, then outputs a summary count of the events received on each file or directory. it's giving "bestie is taking notes on every little filesystem moment" π
fsnotifywatch is similar to inotifywatch but it is using Linux's fanotify(7) interface by default. If explicitly specified, it uses the inotify(7) interface. periodt.
π OUTPUT
inotifywatch and fsnotifywatch will output a table on standard out with one column for each type of event and one row for each watched file or directory. the table will show the amount of times each event occurred for each watched file or directory. output can be sorted by a particular event using the -a or -d options. β¨
some diagnostic information will be output on standard error. that's the little side-commentary, bestie π«Ά
β¨ OPTIONS β¨
-h,--helpβ output some helpful usage information. the "help me help you" option π-v,--verboseβ output some extra information on standard error during execution. it's the "tell me everything" vibe.@<file>β when watching a directory tree recursively, exclude the specified file from being watched. the file must be specified with a relative or absolute path according to whether a relative or absolute path is given for watched directories. if a specific path is explicitly both included and excluded, it will always be watched.
Note: if you need to watch a directory or file whose name starts with @, give the absolute path. iykyk π
--fromfile <file>β read filenames to watch or exclude from a file, one filename per line. if filenames begin with@they are excluded as described above. if<file>is-, filenames are read from standard input. use this option if you need to watch too many files to pass in as command line arguments. truly the "i have 5000 files and a dream" option π¦-z,--zeroβ output table rows and columns even if all elements are zero. by default, rows and columns are only output if they contain non-zero elements. using this option when watching for every event on a lot of files can result in a lot of output! like, a lot a lot π--exclude <pattern>β do not process any events for the subset of files whose filenames match the specified POSIX regular expression, case sensitive.--excludei <pattern>β do not process any events for the subset of files whose filenames match the specified POSIX regular expression, case insensitive.--include <pattern>β process events only for the subset of files whose filenames match the specified POSIX regular expression, case sensitive.--includei <pattern>β process events only for the subset of files whose filenames match the specified POSIX regular expression, case insensitive.-r,--recursiveβ watch all subdirectories of any directories passed as arguments. watches will be set up recursively to an unlimited depth. symbolic links are not traversed. if new directories are created within watched directories they will automatically be watched.
Warning: if you use this option while watching the root directory of a large tree, it may take quite a while until all inotify watches are established, and events will not be received in this time. also, since one inotify watch will be established per subdirectory, it is possible that the maximum amount of inotify watches per user will be reached. the default maximum is 8192; it can be increased by writing to /proc/sys/fs/inotify/max_user_watches. bestie, root-directory recursive watching is not for the faint of heart π
-P,--no-dereferenceβ do not follow symlinks. simple. clean. no symlink shenanigans.-t <seconds>,--timeout <seconds>β listen only for the specified amount of seconds. if not specified,inotifywatchwill gather statistics until receiving an interrupt signal by (for example) pressing CONTROL-C at the console. so you can let it cook until you say stop π-e <event>,--event <event>β listen for specific event(s) only. the events which can be listened for are listed in theEVENTSsection. this option can be specified more than once. if omitted, all events are listened for.-a <event>,--ascending <event>β sort output ascending by event counts for the specified event. sortable events includetotaland all the events listed in theEVENTSsection exceptmoveandclose(you must usemoved_to,moved_from,close_writeorclose_nowriteinstead). the default is to sort descending bytotal.-d <event>,--descending <event>β sort output descending by event counts for the specified event. sortable events includetotaland all the events listed in theEVENTSsection exceptmoveandclose(you must usemoved_to,moved_from,close_writeorclose_nowriteinstead). the default is to sort descending bytotal.-I,--inotifyβ watch using inotify (default forinotifywatch). the classic. the main character. π-F,--fanotifyβ watch using fanotify (default forfsnotifywatch). fanotify support for reporting events with inotify compatible information was added in kernel v5.9. with older kernels the command will fail. as of kernel v5.12, fanotify requires admin privileges. so check your kernel and your privileges, bestie β this is not a drill π¨-S,--filesystemβ watch entire filesystem of any directories passed as arguments using fanotify. it's giving "whole filesystem, no crumbs" π-M,--mountβ watch entire mount of any directories passed as arguments using fanotify. not just a folder, the whole mount vibe π
π SEE ALSO π«Ά
okay so like, if you want the other half of the inotify experience β the one where you actually watch stuff happen live instead of counting it all up afterwards β go read:
inotifywait(1)β the sister tool fr fr, it just sits there and waits for events to happen and tells you the second they do πinotify(7)β the big one, the lore, the actual kernel interface behind all this π read it if you wanna know what's really going on under the hood, no cap
and that's the whole page bestie!! π¦β¨ this is inotifywatch from version 4.26.0, dated 2026-10-07 β go forth and count your events, you're literally gonna slay π
π
π¦ where this page comes from
- arch rolling: inotify-tools 4.26.270-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms