See changes made to a filesystem with inotify


Install the package “inotify-tools” with your package manager (in EPEL for RHEL).

Then create and execute this script :

inotifywait -m -r --format $'%T %e %w%f' --timefmt '%H:%M:%S' --exclude ~/'(\.mozilla|Documents/KeepNote)' -e modify -e move -e create -e delete ~ 2>&1 | awk '/^[0-9]/ {
sub(/'"${HOME//\//\\/}"'/, "~", $0)
split($0, a, " ")
printf "%-20s %s\n", substr($0, 0, len), substr($0, len+2)
// flush stdout
{print ; system("")}
' | tee -a /tmp/home_monitor

Source :

Thanks for reading this post!

If you found an issue in this article, you can create an issue on Github.

If you have a comment or question, please drop me a line below!